Practica Laboratorio (Matlab)
Practica Laboratorio (Matlab)
Practica Laboratorio (Matlab)
ALEXANDER GUTIERREZ
octave:20> A=[2,4,6,10,8;4,6,1,10,2;3,0,8,5,1;2,4,1,5,2;0,0,2,4,6]
A=
2 4 6 10 8
4 6 1 10 2
3 0 8 5 1
2 4 1 5 2
0 0 2 4 6
octave:21> b=[8;10;2;2;4]
b=
8
10
2
2
4
octave:22> A=[A,b]
A=
2 4 6 10 8 8
4 6 1 10 2 10
3 0 8 5 1 2
2 4 1 5 2 2
0 0 2 4 6 4
octave:23> A(1,1:6)=A(1,1:6)/A(1,1)
A=
1 2 3 5 4 4
4 6 1 10 2 10
3 0 8 5 1 2
2 4 1 5 2 2
0 0 2 4 6 4
>>> A(2,1:6)=A(2,1:6)-A(5,3)*(4,1:6)
^
octave:24> A(2,1:6)=A(2,1:6)-A(5,3)*A(4,1:6)
A=
1 2 3 5 4 4
0 -2 -1 0 -2 6
3 0 8 5 1 2
2 4 1 5 2 2
0 0 2 4 6 4
octave:25> A(3,1:6)=A(3,1:6)-A(3,1)*A(1,1:6)
A=
1 2 3 5 4 4
0 -2 -1 0 -2 6
0 -6 -1 -10 -11 -10
2 4 1 5 2 2
0 0 2 4 6 4
octave:26> A(4,1:6)=A(4,1:6)-A(4,1)*A(1,1:6)
A=
1 2 3 5 4 4
0 -2 -1 0 -2 6
0 -6 -1 -10 -11 -10
0 0 -5 -5 -6 -6
0 0 2 4 6 4
octave:27> A(2,2:6)=A(2,2:6)/A(2,2)
A=
octave:28> A(1,2:6)=A(1,2:6)-A(1,2)*A(2,2:6)
A=
octave:29> A(3,2:6)=A(3,2:6)-A(3,2)*A(2,2:6)
A=
octave:30> A(3,3:6)=A(3,3:6)/A(3,3)
A=
octave:32> A(2,3:6)=A(2,3:6)-A(2,3)*A(3,3:6)
A=
octave:33> A(4,3:6)=A(4,3:6)-A(4,3)*A(3,3:6)
A=
octave:34> A(5,3:6)=A(5,3:6)-A(5,3)*A(3,3:6)
A=
octave:36> A(1,4:6)=A(1,4:6)-A(1,4)*A(4,4:6)
A=
octave:37> A(2,4:6)=A(2,4:6)-A(2,4)*A(4,4:6)
A=
octave:38> A(3,4:6)=A(3,4:6)-A(3,4)*A(4,4:6)
A=
octave:40> A(5,5:6)=A(5,5:6)/A(5,5)
A=
octave:41> A(1,5:6)=A(1,5:6)-A(1,5)*A(5,5:6)
A=
>>> A=(2,5:6)=A(2,5:6)-A(2.5)*A(5,5:6)
A=
octave:44> A(4,5:6)=A(4,5:6)-A(4,5)*A(5,5:6)
A=
octave:45> X=A(1:5,6)
X=
-3.29577
-1.29577
-0.47887
3.43662
-1.46479
octave:46> A=[2,4,6,10,8;4,6,1,10,2;3,0,8,5,1;2,4,1,5,2;0,0,2,4,6]
A=
2 4 6 10 8
4 6 1 10 2
3 0 8 5 1
2 4 1 5 2
0 0 2 4 6
octave:47> A*X
ans =
8.0000
10.0000
2.0000
2.0000
4.0000