How to solve this question?
7 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
dpb
2015 年 10 月 18 日
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)...
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Linear Algebra についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!