Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 3 a: Create a Function for Crout (LU) Reduction (9 pts) Do not use any of MatLab's built in functions or commands. This MUST
Task 3 a: Create a Function for Crout (LU) Reduction (9 pts) Do not use any of MatLab's built in functions or commands. This MUST be implemented using matrix and vector components via FOR loops in your construction Use Crout reduction to convert a square matrix A into the product of triangular matrices LU Use the MatLab commands L = zeros(n) and U = eye(n) to initialize matrices L and U, and then preform a reduction by implementing the algorithm for k-1:n for i = k:n LU for j=k+ 1:n k-1 k j m=1 where A is a square matrix of dimension n x n, L will be a lower-triangular matrix of dimension n x n, and U will be an upper-triangular matrix of like dimension nx n. No pivoting is to be programmed into your code. Create a function crout _LU.m with interface L, u crout_LU (A) and it needs to verify that A is a square n x n matrix with numeric elements, where n is arbitrary; if not your code should terminate with an error. It should write a warning message to the command window if any diagonal element of the reduced matrix L is zero valued Task 3b : Solve Ax = b (4 pts) Create a function solve_LU.m that has two interfaces x = solve-LU (A, b) [x, L, U] = solve-LU (A, b) and it needs to verify that A is a square nx n matrix with numeric values, while b is a column vector of like dimension n containing numeric values, where n is arbitrary; if not your code should terminate with an error. It should also terminate with an error if any diagonal element of matrix A is zero valued. This function should first call crout_LU, then call forward_elim and finally call backward elim
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started