Question: Finish the following MATLAB function program: function [x1, r1, x2, r2] % Solves linear systems using the LU decomposition with pivoting % and also

Finish the following MATLAB function program: =function [x1, ri, x2, r2] mysolve (A,b) % Solves linear systems using the LU 

Finish the following MATLAB function program: function [x1, r1, x2, r2] % Solves linear systems using the LU decomposition with pivoting % and also with the built -in solve function A\b. % Inputs: A % mysolve (A, b) %3D the matrix -- b the right-hand vector the solution using the LU method the norm of the residual using the LU method -- % Outputs : x1 -- r1 -- x2 the solution using the built -in method the norm of the residual using the r2 built -in method Using format long, test the program on both random matrices (randn (n,n)) and Hilbert matrices (hilb(n)) with n large (as big as you can make it and the program still run). Print your program and summarize your observations. (Do not print any random matrices or vectors.)

Step by Step Solution

3.48 Rating (165 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Implementation of mysolve function clearvars For testing mysolve funtio... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (2 attachments)

PDF file Icon

635d9d8ac6d64_177315.pdf

180 KBs PDF File

Word file Icon

635d9d8ac6d64_177315.docx

120 KBs Word File

Students Have Also Explored These Related Accounting Questions!