How to solve this question?
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentario
dpb
el 18 de Oct. de 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)...
Respuestas (0)
Ver también
Categorías
Más información sobre Linear Algebra en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!