How to solve this question?

7 ビュー (過去 30 日間)
Shun Weng
Shun Weng 2015 年 10 月 18 日
コメント済み: dpb 2015 年 10 月 18 日
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
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 ExchangeLinear Algebra についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by