(a) Write a well-commented Matlab function program mysolvecheck with input a number n
that makes a random n × n matrix A and a random vector b, solves the linear system Ax = b,
calculates the magnitude of the residual r = Ax − b, and outputs that number as the error e.
I have this part done on my other computer, I cannot retrieve it right now because I accidentally saved it to my desktop so I dont need this part, but I can't give you what I have currently. Its a pretty easy code.
(b) Write a well-commented Matlab script program that calls mysolvecheck 5 times each for
n = 5, 10, 50, 100, 500, and 1000, records and averages the results, and makes a log-log plot of
the average e vs. n.
This is the part where I am struggling, please offer either some psuedo code or some actual code that can get me going in the right direction!