Something wrong with Matlab's LU decomposition:
4 views (last 30 days)
Show older comments
Example:
A=[-1.0000 0.1667 -2.9897
0.3624 -1.0604 -0.5243
4.0990 -4.5547 7.0303]
[L,U]=lu(A)
L=[-0.2440 1.0000 0
0.0884 0.6964 1.0000
1.0000 0 0]
U=[4.0990 -4.5547 7.0303
0 -0.9445 -1.2746
0 0 -0.2583]
A correct answer is
L=[1.0000 0 0
-0.3624 1.0000 0
-4.0990 3.8714 1.0000]
U=[-1.0000 0.1667 -2.9897
0 -1.0000 -1.6078
0 0 1.0000]
1 Comment
David Goodmanson
on 11 Jan 2024
Hi LK
There is nothing really wrong here. 'help lu' tells you that [L U] = lu(A) gives a row-permuted L matrix (it's not necessarily lower triangular any more) so that A = LU. The command [L U P] = lu(A) gives a true lower triangular matrix L and a permutation matrix P such that PA = LU, or (since P' is the inverse of P), A = P'LU. All of this done to allow pivoting so that the computed L and U have maximal numerical accuracy.
Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!