Question: 1 0 . 6 Develop your own M - file to determine the ( L U ) factorization of a square matrix without
Develop your own Mfile to determine the L U factorization of a square matrix without partial pivoting. That is develop a function that is passed the square matrix and returns the triangular matrices L and U Test your function by using it to solve the system in Prob. Confirm that your function is working properly by verifying that LUA and by using the builtin function lu
Hint: most of the code is listed below.
function L U LUNaive A
LUNaiveA:
LU decomposition without pivoting.
input:
A coefficient matrix
output:
L lower triangular matrix
U upper triangular matrix
mnsizeA;
if m~n errorMatrix A must be square'; end
L eyen;
forward elimination
for k :n
for i k:n
LiktextrmUiktextrmUkk
Uik;
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
end
end
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
