Professional Documents
Culture Documents
ar
Ejercicio 1)a)
A=
1 2 -1
4 0 -2
2 1 3
>> B=[2 3 5; 1 -1 4]
B=
2 3 5
1 -1 4
>> C=B'
C=
2 1
3 -1
5 4
>> A*C
ans =
3 -5
-2 -4
22 13
b)
>> inv(A)
ans =
-0.0588 0.2059 0.1176
0.4706 -0.1471 0.0588
-0.1176 -0.0882 0.2353
Ejercicio 2
A=
1 3 2
2 2 -1
-1 4 3
3 -1 0
2 2 2
>> Q=orth(A)
Q=
0.5346 0.1187 0.0196
0.1960 0.4680 -0.8434
0.6948 -0.3869 0.0473
-0.0614 0.6982 0.4136
0.4349 0.3598 0.3388
Ejercicio 3)a)
A=
1 2 -1
4 2 0
6 1 -2
3 1 -1
2 5 -2
>> [QR]=qr(A)
QR =
-8.1240 -3.5697 2.4618
0.4384 4.7178 -1.3167
0.6576 0.5161 1.4851
0.3288 0.1611 0.1192
0.2192 -0.7325 -0.3125
b)
A=
2 1 -1 3
-1 4 2 5
0 3 -2 4
>> [QR]=qr(A)
QR =
-2.2361 0.8944 1.7889 -0.4472
-0.2361 -5.0200 0.1195 -7.0518
0.0000 0.3317 -2.4054 -0.2673
Ejercicio 4)a)
>> x=-3:0.1:6;
y=-2*x+1;
plot(x,y)
grid
title('función y')
b)
>>x=-5:0.1:5;
y=2*(x.^2)-3*x+4;
plot(x,y)
grid
title('función y')
c)
>> x=0:2*pi;
y=sin(x);
plot(x,y)
grid
title('funcion seno de x')
Ejercicio 5)a)
A=
1 3
2 -1
>> b=[2;-1]
b=
2
-1
>> X=A^(-1)*b
X=
-0.1429
0.7143
>> x1=-6:0.1:6;
>> y1=-1/3*x1+2/3;
>> x2=-6:0.1:6;
>> y2=2*x2+1;
>> plot(x1,y1,'r-',x2,y2,'b:')
>> grid
>> title('Interseccion de rectas Ej 5 a)')
b)
A=
1 2
2 4
>> b=[4;6]
b=
4
6
>> X=A^(-1)*b
Warning: Matrix is singular to working precision.
X=
Inf
Inf
>> x1=-8:0.1:8;
>> y1=-1/2*x1+2;
>> x2=-8:0.1:8;
>> y2=-1/2*x2+3/2;
>> plot(x1,y1,'r-',x2,y2,'b:')
>> grid
>> title('Interseccion de rectas Ej 5 b)')