Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Given matrix A.
- [L,U,P] = lu(A); % calculate partial-pivoted LU decomposition of A
- D = diag(diag(U)); % get diagonal matrix
- U = DU; % the 'U' that is needed is really inv(D)*U
- A = [1 2 3 ; 4 5 6 ; 7 8 9] ;
- [L U P] = lu(A) ; % calculate p-p LU decomp.
- D = diag(diag(L)) ; % get diagonal matrix
- L * D * U % check left side
- P * A % check right
Add Comment
Please, Sign In to add comment