How to solve this question?

10 次查看(过去 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 CenterFile Exchange 中查找有关 Linear Algebra 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by