Documente Academic
Documente Profesional
Documente Cultură
funciones a utilizar:
1 -0 0 0
7 -29 0 0
1 -0 8 0
0 2 91/29 569/116
1 3 -4 3
-0 1 -31/29 19/29
0 0 1 1/4
0 0 0 1
>> A=L*U //comprobamos que LU=A .....
A =
1 3 -4 3
7 -8 3 2
1 3 4 5
0 2 1 7
ITERACIONES.-
eye(4)
ans =
Diagonal Matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
>> L=ans
L =
Diagonal Matrix
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
>> U=[1 3 -4 3; 7 -8 3 2; 1 3 4 5; 0 2 1 7]
U =
1 3 -4 3
7 -8 3 2
1 3 4 5
0 2 1 7
[L,U]=convertir_ceros_LU(1,2,1,L,U)
L =
1 0 0 0
7 1 0 0
0 0 1 0
0 0 0 1
U =
1 3 -4 3
0 -29 31 -19
1 3 4 5
0 2 1 7
>> [L,U]=convertir_ceros_LU(1,3,1,L,U)
L =
1 0 0 0
7 1 0 0
1 0 1 0
0 0 0 1
U =
1 3 -4 3
0 -29 31 -19
0 0 8 2
0 2 1 7
[L,U]= convertir_ceros_LU(2,3,2,L,U)
L =
1 0 0 0
7 1 0 0
1 0 1 0
0 0 0 1
U =
1 3 -4 3
0 -29 31 -19
0 0 8 2
0 2 1 7
>> [L,U]=convertir_ceros_LU(2,4,2,L,U)
L =
U =
U =
1 0 0 0
7 1 0 0
1 0 1 0
0 -2/29 91/232 1
>> U
U =
1 3 -4 3
0 -29 31 -19
0 0 8 2
0 0 0 569/116
diagonal_LU(L,U)
ans =
1 -0 0 0
7 -29 0 0
1 -0 8 0
0 2 91/29 569/116
>> L
L =
1 0 0 0
7 1 0 0
1 0 1 0
0 -2/29 91/232 1
>> U
U =
1 3 -4 3
0 -29 31 -19
0 0 8 2
0 0 0 569/116
[L,U]=diagonal_LU(L,U)
L =
1 -0 0 0
7 -29 0 0
1 -0 8 0
0 2 91/29 569/116
U =
1 3 -4 3
-0 1 -31/29 19/29
0 0 1 1/4
0 0 0 1
>> A=L*U
A =
1 3 -4 3
7 -8 3 2
1 3 4 5
0 2 1 7
Como se quera