Something wrong with Matlab's LU decomposition:

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 个评论

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.

请先登录,再进行评论。

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by