Question: 1) In this problem, you wil convert a function that performs GE (Guassian Elimination) to one that performs GEPP Gaussian Elimination with Partial Pivoting) a)
1) In this problem, you wil convert a function that performs GE (Guassian Elimination) to one that performs GEPP Gaussian Elimination with Partial Pivoting) a) Modify the function gael.m (posted in eLearning), so that it accepts only the A matrix as input, and produces only two outputs. One output will be the modified (overwritten) version of A, which contains the multipliers in the lower triangular portion, along with the upper triangular matrix generated by GEPP. The other output will be the n n permutation matrix P also generated during GEPP. Call your modified function gaelpp.m so that the first line is: function [A,P] = gaelpp(A) Hints: . You can use the MATLAB function eye() to initialize P. . The MATLAB function /MJ) = max(AG-nj) will return an index 1 for the location of the maximum value of the column vector AG:nj). Note that you will need to adjust this index and also use the absolute value. You wl also need to swap rows of P accordingly. in M. . You will aso neod to swap rows of P accordingly. You need to overwrite appropriate entries of A with the multipliers instead of saving them b) Write a script gaelppscript.m to test your function from part (a). Use the A and b as defined in Sauer, Example 2.17, p.99 (1 ed., p.106). This script will also call the functions forsub.nm and backsub.m with appropriate inputs (also provided in eLearning). Display your computed solution. You do not need to use any loops in this script
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
