Está en la página 1de 7

UNIVERSIDAD NACIONAL DEL CALLAO

ASIGNATURA: SOFWARE DE SIMULACION (LABORATORIO)


GRUPO/TURNO: 93G/ Jueves de 2:00 a 4:00 pm
PROFESOR: CONDOR DE LA CRUZ, FLAVIO
INTEGRANTES:
AIRE VALENCIA FRANK 1213220411
LOYO MAYANDIA KEVIN 1213220545

Ao:

2013
Ao de la Inversin para el Desarrollo Rural y la Seguridad Alimentaria

INFORME N 6: VECTORES Y MATRICES EN MATLAB



MATLAB: VECTORES Y MATRICES


pg. 1

VECTORES
1.
(a) >> vect1=0:0.5:4.5
vect1 =
0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000
>> a=[0 0.5 1 1.5 2 2.5 3 3.5 4 4.5]
a =
0 0.5000 1.0000 1.5000 2.0000 2.5000 3.0000 3.5000 4.0000 4.5000
(b) >> b=a.*a
b =
0 0.2500 1.0000 2.2500 4.0000 6.2500 9.0000 12.2500 16.0000 20.2500
>> b'
ans =
0
0.2500
1.0000
2.2500
4.0000
6.2500
9.0000
12.2500
16.0000
20.2500



MATLAB: VECTORES Y MATRICES


pg. 2

( c ) >> dot(a,b)
ans =
253.1250
2.
(a)>> V=50:3:480
V =
50 53 56 59 62 65 68 71 74 77
80 83 86 89 92 95 98 101 104 107
110 113 116 119 122 125 128 131 134 137
140 143 146 149 152 155 158 161 164 167
170 173 176 179 182 185 188 191 194 197
200 203 206 209 212 215 218 221 224 227
230 233 236 239 242 245 248 251 254 257
260 263 266 269 272 275 278 281 284 287
290 293 296 299 302 305 308 311 314 317
320 323 326 329 332 335 338 341 344 347
350 353 356 359 362 365 368 371 374 377
380 383 386 389 392 395 398 401 404 407
410 413 416 419 422 425 428 431 434 437
440 443 446 449 452 455 458 461 464 467
470 473 476 479





MATLAB: VECTORES Y MATRICES


pg. 3

(b)>> length(V)
ans =
144
3.
(a)>> dot(u,w)
ans =
45
>> u.*w
ans =
20 -11 36
Uno es el producto escalar (un numero) el Segundo es el producto de vectores componente por
componente
(b)>> norm(u,'fro')
ans =
19.1050
>> norm(w,'fro')
ans =
3.7417
( c )>> x=acos(dot(u,w)/norm(norm(u,'fro')*norm(w,'fro'),'fro'))
x =
0.8899
>> x*180/pi
ans = 50.9861




MATLAB: VECTORES Y MATRICES


pg. 4

Matrices
1.-Dada la matriz
>> A=[1 2 3 4 5;6 7 8 9 10; 11 13 15 17 19]
A =
1 2 3 4 5
6 7 8 9 10
11 13 15 17 19
(a)Transpuesta
>> T=A'
T =
1 6 11
2 7 13
3 8 15
4 9 17
5 10 19
(b) Matriz de elementos 1, igual dimensiones de A.
>> ones(3,5)
ans =
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1




MATLAB: VECTORES Y MATRICES


pg. 5

(c) Matriz B es simtrica
>> B=[2 -1 0; -1 2 -1; 0 -1 2]
B =
2 -1 0
-1 2 -1
0 -1 2
>>B'
ans =
2 -1 0
-1 2 -1
0 -1 2
>> B*A
ans =
-4 -3 -2 -1 0
0 -1 -2 -3 -4
16 19 22 25 28
2.- Sea la matriz
J =
1 2 3 4
5 6 7 8
9 10 11 12
20 0 5 4
(a) Un vector de la tercera columna de J



MATLAB: VECTORES Y MATRICES


pg. 6

>>H = J(:,3)
H =
3
7
11
5
(b) Un vector igual a la cuarta fila de J
>> K = J(4,:)
K =
20 0 5 4
(c) Matriz (4X2) formado por segunda y tercera columna de J.
>> c = J(:,3);
>> d = J(:,2);
>> Z=[c , d]
Z =
3 2
7 6
11 10
5 0
(d) Matriz (2X2) formado por elementos de segunda y tercera filas y la segunda y tecera
columna de J.
>>H = J(2:3,[2 3])
ans =
6 7
10 11

También podría gustarte