Question: Create a MATLAB function called 'LU_hw3.m' that takes the following input: a nxn regular matrix A and returns the following outputs: the nxn lower-triangular

Create a MATLAB function called 'LU_hw3.m' that takes the following input: a nxn regular matrix A and returns the following outputs: the nxn lower-triangular matrix L of the LU decomposition of A the nxn upper-triangular matrix U of the LU decomposition of A. You may want to build into your function an error message if the matrix A is not regular, although this is not required for this exercise. Hint: Modify the regular Gaussian elimination code presented in Component Skill 3.3. Test your function on some easy regular matrices of your choice. Once you're confident your code is correct, copy the contents of your function file and paste them to the very bottom of your hw3.m script file. In the Exercise 1 section of your script file, evaluate your LU_hw3 function for the following matrix: 1 1 3 -1 A = 4 3 5 3 Assign the resulting L matrix to the variable A1 and the resulting U matrix to the variable A2.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
