Está en la página 1de 5

EXAMEN DE LABORATORIO

PROBLEMA 1
>> A=[ 1:3;4:6;7:9]
A=
1 2 3
4 5 6
7 8 9
>> B=[ 1 2 4;6 8 10;12 14 16]
B=
1 2 4
6 8 10
12 14 16
>> C=[ 1 3 6;9 12 15;18 21 24]
C=
1 3 6
9 12 15
18 21 24
PARTE A
>> N=A^(2)
N=
30 36 42
66 81 96
102 126 150
>> N1=B'
N1 =
1 6 12
2 8 14
4 10 16
>> N2=C^-1
N2 =
1.0000 -2.0000 1.0000
-2.0000 3.1111 -1.4444
1.0000 -1.2222 0.5556
>> N2=C^(-1)
N2 =
1.0000 -2.0000 1.0000
-2.0000 3.1111 -1.4444
1.0000 -1.2222 0.5556
>> N3=N2^(-1)
N3 =
1.0000 3.0000 6.0000
9.0000 12.0000 15.0000
18.0000 21.0000 24.0000
>> N3=det(N+N1+N2)
N3 =
-5.1757e+003
PARTE B
>> b=(A-B)
b=
0 0 -1
-2 -3 -4

-5 -6 -7
>> b1=A(3,1)
b1 =
7
>> b2=det(b+b1)
b2 =
3.0000
PARTE C
>> c=(B^-1)
c=
1.0000 -2.0000 1.0000
-2.0000 2.6667 -1.1667
1.0000 -0.8333 0.3333
>> c1=c*A
c1 =
0.0000 0.0000
0
0.5000 0.0000 -0.5000
0 0.5000 1.0000
>> c2=c*C
c2 =
1.0000 0.0000
0
1.0000 1.5000 0.0000
-0.5000
0 1.5000
>> sin(c1+c2)
ans =
0.8415 0.0000
0
0.9975 0.9975 -0.4794
-0.4794 0.4794 0.5985
PARTE D
>> d1=A'
d1 =
1 4 7
2 5 8
3 6 9
>> d2=B'
d2 =
1 6 12
2 8 14
4 10 16
>> d3=det(d1)^2
d3 =
0
>> d4=det(d2)^2
d4 =
144.0000
>> d5=cosh(d3+d4)
d5 =
1.7273e+062
PARTE E
>> e1=det(A)
e1 =
6.6613e-016

>> e2=B^(-1)
e2 =
1.0000 -2.0000
-2.0000 2.6667
1.0000 -0.8333
>> e3=cos(e1+e2)
e3 =
0.5403 -0.4161
-0.4161 -0.8893
0.5403 0.6724

1.0000
-1.1667
0.3333

0.5403
0.3932
0.9450

PROBLEMA 2
PARTE A
>> floor(sqrt(2012))
ans =
44
PARTE B
>> sqrt((1+atan(5)^3))
ans =
1.8949
PARTE C
>> exp(log(5)+sqrt(57)-cosh(5*(pi/8)))
ans =
251.3876
PARTE D
>> atan(0.1+0.1+(0.1/2)+(0.1/3)+(0.1/4)+(0.1/5))
ans =
0.3172
PARTE E
>> abs((sin(5)^2+(cos(10)^2)))
ans =
1.6236

PROBLEMA 3
>> A3=pascal(6)
A3 =
1 1 1 1
1 2 3 4
1 3 6 10
1 4 10 20
1 5 15 35
1 6 21 56
>> B3=[10:2:20]'
B3 =
10
12
14
16
18
20

1 1
5 6
15 21
35 56
70 126
126 252

Demostraremos que
A=A'
A=
1 1 1 1 1 1
1 2 3 4 5 6
1 3 6 10 15 21
1 4 10 20 35 56
1 5 15 35 70 126
1 6 21 56 126 252
>> A'=A
>> A1=A(1)
A1 =
1
>> A2=A(1:2,1:2)
A2 =
1 1
1 2
>> A3=A(1:3,1:3)
A3 =
1 1 1
1 2 3
1 3 6
>> A4=A(1:4,1:4)
A4 =
1 1 1 1
1 2 3 4
1 3 6 10
1 4 10 20
>> A5=A(1:5,1:5)
A5 =
1 1 1 1 1
1 2 3 4 5
1 3 6 10 15
1 4 10 20 35
1 5 15 35 70
>> det(A1)
ans =
1
>> det(A2)
ans =
1
>> det(A3)
ans =
1
>> det(A4)
ans =
1.0000
>> det(A5)
ans =
1
SE COMPRUEBA QUE A ES POSITVA

>> R=chol(A)
R=
1 1 1
0 1 2
0 0 1
0 0 0
0 0 0
0 0 0
>> M=R'
M=
1 0 0
1 1 0
1 2 1
1 3 3
1 4 6
1 5 10
>> b
b=
10
12
14
16
18
20
>> y=M\b
y=
10
2
0
0
0
0
>> x=R\y
x=
8
2
0
0
0
0

1
3
3
1
0
0

1 1
4 5
6 10
4 10
1 5
0 1

0
0
0
1
4
10

0
0
0
0
1

0
0
0
0
0
5