Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(a) Write a well-commented MATLAB function program mysolvecheck with input a number n that makes a random n x n matrix A and a random
(a) Write a well-commented MATLAB function program mysolvecheck with input a number n that makes a random n x n matrix A and a random vector b, solves the linear system Ax = b, calculates the scalar residual r = || Ax b||, and outputs that number as r. (b) Write a well-commented MATLAB script program that calls mysolvecheck 10 times each for n = 5, 10, 20, 40, 80, and 160, then records and averages the results and makes a log-log plot of the average r vs. n. Once your program is running correctly, increase the maximum n (by factors of 2) until the program stops running within 5 minutes
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