Wrong answers given by MATLAB LU Factorization
4 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
LU factorization or decomposition method is supposed to decompose a square matrix to a lower matrix and a upper matrix. However, I tried to test some 2 by 2 matrix, the MATLAB LU method sometimes give me 2 upper matrix. Such an original matrix as:
A=[4 , 3 ; 6 , 3]
The answer given by MATLAB:
[L,U]=lu(A)
L=[0.667,1 ; 1, 0]
U=[6, 3 ; 0, 1]
The correct answer should be
L=[1 , 0 ; 1.5, 1]
U=[4 , 3 ; 0, -1.5]
I don't understand why MATLAB gives me such answer
Please, someone help me!
0 comentarios
Respuestas (2)
Sean de Wolski
el 15 de En. de 2014
The behavior you are seeing is described in Example 1 of the lu documentation:
José-Luis
el 15 de En. de 2014
Both answers are valid.
A = [2/3,1 ; 1, 0] *[6, 3 ; 0, 1]
B = [1 , 0 ; 1.5, 1] * [4 , 3 ; 0, -1.5]
A == B
2 comentarios
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!