Documentos de Académico
Documentos de Profesional
Documentos de Cultura
figure; imshow(imagen_var);
Permite ver los valores de cada uno de los pixeles en la imagen:
figure; imshow(imagen_var);pixval on;
Visualizar segn tipo de dato
La funcin imshow permite visualizar una imagen del tipo uint8 ([0,255]) como
distintos niveles de gris:
La funcin imshow visualiza una imagen del tipo double([0,1]) como distintos
niveles de gris
Funciones para definir matrices bsicas
Existen en MATLAB varias funciones orientadas a definir con gran facilidad
matrices de tipos particulares.
Algunas de estas funciones son las siguientes:
eye(n) forma la matriz unidad de tamao (nxn)
zeros(n,m) forma una matriz de ceros de tamao (nxm)
zeros(n) dem de tamao (nxn)
ones(n) forma una matriz de unos de tamao (nxn)
ones(n,m) idem de tamao (nxm)
linspace(x1,x2,n) genera un vector con n valores igualmente espaciados entre
x1 y x2
rand(n) forma una matriz de nmeros aleatorios entre 0 y 1,
con distribucin uniforme, de tamao (nxn)
rand(n,m) idem de tamao (nxm)
9 10
0 0
0 0
0 0
0 0
0 0
0 0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
7
0
0
0
0
0
0
0
6
0
0
0
0
0
0
0
5
0
0
0
0
0
0
0
4
0
0
0
0
0
0
0
3
0
0
0
0
0
0
0
2
0
0
0
0
0
0
0
1
5 6
4 5
3 4
2 3
1 2
2 1
3 2
4 3
5 4
6 5
7 8
6 7
5 6
4 5
3 4
2 3
1 2
2 1
3 2
4 3
9 10
8 9
7 8
6 7
5 6
4 5
3 4
2 3
1 2
2 1
5
4
3
2
10
9
8
7
6
5
6
5
4
3
2
10
9
8
7
6
7 8 9 10
6 7 8 9
5 6 7 8
4 5 6 7
3 4 5 6
2 3 4 5
10 2 3 4
9 10 2 3
8 9 10 2
7 8 9 10
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
0
0
0
0
0
0
0
0
0
0
1
49
49
49
49
49
49
49
61
61
61
61
61
61
61
74
74
74
74
74
74
74
87
87
87
87
87
87
87
100
100
100
100
100
100
100
10
23 36 49 61 74 87 100
5
18
1
10
3
8 16
13 13
22 18
21 18
6 11
13 14
BASANDOSE
EN
>> y=ones(3,4)
y=
1 1 1 1
1 1 1 1
1 1 1 1
>> d=blkdiag(y,0,0)
d=
1 1 1 1 0
1 1 1 1 0
1 1 1 1 0
0 0 0 0 0
0 0 0 0 0
0
0
0
0
0
0.8407
0.2543
0.8143
0.0782
0.4427
0.1067
0.9619
0.0046
0.2435
0.9293
0.3500
0.7749
0.8173
0.8687
0.0844
0.3998
0.1966
0.2511
0.6160
0.2599
0.8001
0.4314
0.9106
0.1818
0.4733
0.3517
0.8308
0.2638
0.1455
0.1361
0.8693
0.5797
0.5853
0.5497
0.9172
0.5499
0.1450
0.8530
0.6221
0.3510
0.2858
0.7572
0.7537
0.5132
0.4018
0.0760
0.2399
0.1233
0.3804
0.5678
0.0759
0.1839
0.2400
0.4173
0.0497
0.9027
0.1622
0.7943
0.3112
0.5752
0.0598
0.2348
0.3532
0.8212
0.9644
0.4325
0.6948
0.7581
0.4326
0.6555
0.1098
0.9338
0.1875
0.2662
0.7978
0.4876
0.7690
0.3960
0.2729
0.0372
>> Q=[X Y W Z]
Q=
0.0729 0.1175 0.7350 0.7894
0.0885 0.6407 0.9706 0.3677
0.7984 0.3288 0.8669 0.2060
0.9430 0.6538 0.0862 0.0867
>> X1=f(1:4,5);Y1=f(1:4,6);W1=f(1:4,7);Z1=f(1:4,8);
>> Q1=[X1 Y1 W1 Z1]
Q1 =
0.2290 0.5309 0.9644 0.1875
0.6419 0.0915 0.4325 0.2662
0.4845 0.4053 0.6948 0.7978
0.1518 0.1048 0.7581 0.4876
>> X2=f(5:8,1);Y2=f(5:8,2);W2=f(5:8,3);Z2=f(5:8,4);
>> U2=[X2 Y2 W2 Z2]
Q2 =
0.6837 0.7491 0.3664 0.7719
0.1321 0.5832 0.3692 0.2057
0.7227 0.7400 0.6850 0.3883
0.1104 0.2348 0.5979 0.5518
>> X3=f(5:8,5);Y3=f(5:8,6);W3=f(5:8,7);Z3=f(5:8,8);
>> U3=[X3 Y3 W3 Z3]
Q3 =
0.7819 0.1123 0.4326 0.7690
0.1006 0.7844 0.6555 0.3960
0.2941 0.2916 0.1098 0.2729
0.2374 0.6035 0.9338 0.0372
0
0
0
0.5762
0.6834
0.5466
0.4257
0.6444
0.6476
0.6790
0.6358
0.9452
0.2089
0.7093
0.2362
0.1194
0.6073
0.4501
0.4587
0.6619
0.7703
0.3502
0.6620
0.4162
0.8419
0.8329
0.2564
0.6135
0
0
0
0
0
0.1192
0.9398
0.5447 0.9937
0.6473 0.2187
0.4046
0.4484
0.7720
0.9329
0.6963
0.0938
0
0
0
0
0
0.4849
0.3935
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0.8699
0.2648
0.3181
>> a1+d1
ans =
1.0397
1.4161
1.3880
0.2648
0.3181
>> c1+b1
ans =
0.5239
0.9895
0.8565
0.2875
0.0911
>> a1-c1
ans =
0.1884
0.1099
0.3294
-0.2875
-0.0911
>> a1-b1
ans =
0.2026
0.6513
-0.1498
0
0
>> 3*b1
ans =
0.7644
0.6721
2.0035
0
0
0.6456
0.4795
0.6393
0.5439 0.1058
0.7210 0.1097
0.5225 0.0636
0
0
0
0
0
0
1.0628
1.5775
1.6032
0.4795
0.6393
0.7854
1.3234
0.8330
0.7210
0.5225
1.6655
0.9138
0.1738
0.1097
0.0636
0.4046
0.4484
0.3658
0.7635
0.6279
0.7720
0.9329
0.9727
0.1920
0.1389
0
0
0
0
0
0
0
0
0
0
1.4206
1.0278
1.3271
0.4257
0.6444
1.3229
0.6857
1.2380
0.9452
0.2089
1.0961
1.1522
0.1205
0.6073
0.4501
0.9212
1.0863
1.2312
0.3502
0.6620
0.3674
-0.0457
0.4111
-0.4257
-0.6444
-0.4069
-0.0029
-0.3467
-0.9452
-0.2089
-0.0375
0.4589
-0.0514
-0.6073
-0.4501
-0.4587
-0.6619
-0.7703
-0.3502
-0.6620
-0.4162
-0.8419
-0.8329
-0.2564
-0.6135
0.6963
0.0938
0.5254
0.5303
0.8611
0
0
0
0
0
0.4849
0.3935
0.6714
0.7413
0.5201
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
>> image(y)
>> v=axis
v=
0 1 0
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255 255 255 255 255 255 255 255 255 255 255 255 255 255 255 255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
255
TAREA
1. Programar las derivadas de las siguientes funciones en
matlab.
A:
>> syms x;
>> f=(exp(-x)-exp(x))^3
f=
(1/exp(x) - exp(x))^3
>> diff(f,x)
ans =
(-3)*(1/exp(x) + exp(x))*(1/exp(x) - exp(x))^2
B:
>> syms x;
>> f=(2/3)*(sin(x)^(3/2))-(2/7)*(sin(x)^(7/2))
f=
(2*sin(x)^(3/2))/3 - (2*sin(x)^(7/2))/7
>> diff(f,x)
ans =
cos(x)*sin(x)^(1/2) - cos(x)*sin(x)^(5/2)
C:
>> syms t;
>> f=sin(cos(t)^-1)
f=
sin(1/cos(t))
>> diff(f,t)
ans =
0
A: >> syms x;
>> y=sin(x)/(1+cos(x)^2)
y=
sin(x)/(cos(x)^2 + 1)
>> iy=int(y)
iy =
-atan(cos(x))
B: >> syms x;
>> y=x*(csch((x^2)/2)^2)
y=
x/sinh(x^2/2)^2
>> iy=int(y)
iy =
-2/(exp(x^2) - 1)
C: >> syms x;
>> y=1/(25-(x^2))
y=
-1/(x^2 - 25)
>> iy=int(y,x,0,4)
iy =
log(3)/5
CONCLUCIONES
Este primer laboratorio fue satisfactorio ya que se pudo realizar distintas
operaciones en matlab para el manejo de imgenes y matrices mediante
distintos comandos lo que facilito el desarrollo del mismo.