Why does lu function yield different lower triangle matrix if I return [L,U] rather than [L, U, P]?
Mostrar comentarios más antiguos
% square matrix A
A=[10,-7,0;-3,2,6;5,-1,5]
Return only L and U
[L1,U1] = lu(A);
Return L, U and P
[L2,U2,P2] = lu(A);
Compare L1 and L2
L1
L2
Respuesta aceptada
Más respuestas (1)
Steven Lord
el 18 de Mayo de 2022
0 votos
"[L,U] = lu(A) returns an upper triangular matrix U and a matrix L, such that A = L*U. Here, L is a product of the inverse of the permutation matrix and a lower triangular matrix.
[L,U,P] = lu(A) returns an upper triangular matrix U, a lower triangular matrix L, and a permutation matrix P, such that P*A = L*U. The syntax lu(A,'matrix') is identical."
Emphasis added.
1 comentario
John Taranto
el 18 de Mayo de 2022
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!