Question: Exercise. Write a MATLAB function myplu for PLU factorization by modifying the previous function mylu.m. function [L,U,P] = myplu (A) & MYPLU PLU factorization (demo
![the previous function mylu.m. function [L,U,P] = myplu (A) & MYPLU PLU](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66fa2a270819f_82266fa2a2698f60.jpg)
Exercise. Write a MATLAB function myplu for PLU factorization by modifying the previous function mylu.m. function [L,U,P] = myplu (A) & MYPLU PLU factorization (demo only--not stable!). & Input: square matrix & Output: P, L,U permutation, unit lower triangular, and upper triangular such that LUEPA % $ Your code here. % function [LU] mylu (A) % MYLU LU factorization (demo only--not stable!). % Input: A square matrix 8 Output: % LUunit lower triangular and upper triangular LUNA n = length(A); L = eye (n); $ ones on diagonal % Gaussian elimination for j = 1:n-1 for i = j+1:n L(1,1) - A(1,1) / A(1,1); * row multiplier Ali,j:n) = A(1,1:n) - L(1,3)+A(3, 1:n); end end U = triu (A); end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
