Question: Number 1 from pen and paper: Please solve the matlab portion. 1. Suppose you use the following MATLAB function to compute the LU decomposition of

Number 1 from pen and paper:

Please solve the matlab portion.
1. Suppose you use the following MATLAB function to compute the LU decomposition of the matrix A defined in Pen-and-paper Problem 1. Write down actual commands to be executed inside the function for tasks 1, 2, 3. 4 with i-1,2 and relate those commands to the changes in matrices P, L, A. function [L, U, Pludecomp (A,n) L- eye (n); P eye(n); for i1:n-1 val, pos]-max (abs (A(i:n, i))); pivotindexpos 1; if pivotindexi tmp . A(i, i:n); A(1, 1:n) A(pvot index, 1:1); A(pvotindex, i:n) . tmp; tmp Pi, 1:n); PC, 1:n) P(pivot index, 1:n); P(pivotindex, 1:n) -tmp tmp. L(, 1:1-1); L(i, 1:i-1) L(pivotindex, 1:i-1); Lpvotindex, 1:1-1) tmp ; end factors A(i+1:n,i)/A(i,i); L(i+1:n,i)factors; A(i+1 : n , 1+1 : n) A(+1 :n, A(i+1:n,i) - zeros(n-i,1); 1+1 : n) -factor s *A(, +1:n); end 1. Find the LU factorization of the following square matrix A using partial pivoting: 123 A-3 5 4 1. Suppose you use the following MATLAB function to compute the LU decomposition of the matrix A defined in Pen-and-paper Problem 1. Write down actual commands to be executed inside the function for tasks 1, 2, 3. 4 with i-1,2 and relate those commands to the changes in matrices P, L, A. function [L, U, Pludecomp (A,n) L- eye (n); P eye(n); for i1:n-1 val, pos]-max (abs (A(i:n, i))); pivotindexpos 1; if pivotindexi tmp . A(i, i:n); A(1, 1:n) A(pvot index, 1:1); A(pvotindex, i:n) . tmp; tmp Pi, 1:n); PC, 1:n) P(pivot index, 1:n); P(pivotindex, 1:n) -tmp tmp. L(, 1:1-1); L(i, 1:i-1) L(pivotindex, 1:i-1); Lpvotindex, 1:1-1) tmp ; end factors A(i+1:n,i)/A(i,i); L(i+1:n,i)factors; A(i+1 : n , 1+1 : n) A(+1 :n, A(i+1:n,i) - zeros(n-i,1); 1+1 : n) -factor s *A(, +1:n); end 1. Find the LU factorization of the following square matrix A using partial pivoting: 123 A-3 5 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
