LU factorization for rectangular matrix seems incomplete
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
The following example shows 3x4 maxtrix lu factorization in MATLAB seems incomplete.
MATLAB's answer for u is [1 3 3 2; 0 0 3 3; 0 0 6 6].
The answer in the text book (Gilbert Strang) is [1 3 3 2; 0 0 3 3; 0 0 0 0].
Is thera a way to get the same answer as the one from the text book through MATLAB?
----------------------------------------------------------------------------------------------------------
a =
[ 1, 3, 3, 2]
[ 2, 6, 9, 7]
[ -1, -3, 3, 4]
>> [l,u,p]=lu(a)
l =
[ 1, 0, 0]
[ 2, 1, 0]
[ -1, 0, 1]
u =
[ 1, 3, 3, 2]
[ 0, 0, 3, 3]
[ 0, 0, 6, 6]
p =
1 0 0
0 1 0
0 0 1
6 commentaires
Bruno Luong
le 19 Nov 2018
Modifié(e) : Bruno Luong
le 19 Nov 2018
"I don't understand why it stopped pivoting at the second row."
It does NOT stop, at the second step it pivots at the diagonal elements which is 0 for both row 2 and 3 (draw) so it picks row 2. Elements above/on the right the diagonal of u are not supposed to play any role.
In your book it selects row 3, but it is just a choise, without any additional usefulness for what it design for: solving linear system.
Both are equally valid.
Réponses (0)
Voir également
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!