How to solve this question?
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Write an m-file function called lup_decomp.m that decomposes a matrix A into L, U, and P. U is found using Gaussian Elimination with partial pivoting.
To find P and L:
(1) Start with P = I, and L = 0
(2) We set the elements of L as we do in L U decomposition (using the factors calculated from Gaussian Elimination).
(3) Whenever we swap rows during the course of partial pivoting, we also swap the same rows in L and P.
(4) When we are all finished, we set the diagonal elements of L to 1.
Inputs: A The matrix to decompose
Outputs:
L The lower triangular matrix
U The upper triangular matrix
P The permutation matrix
Yes, this is a homework problem. I'm not asking for answer but some tips on how to solve this cause I don't even know where to start.
1 commentaire
dpb
le 18 Oct 2015
Well, certainly you must know the first line...and certainly 1). Then one would presume if you've been doing the homework up to now you've already got the routine needed for 2)...
Réponses (0)
Voir également
Catégories
En savoir plus sur Linear Algebra dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!