Question: Write a MATLAB code that does the following: 1 . Repeat 1 0 0 times Generates a random 1 0 times 1 vector b
Write a MATLAB code that does the following:
Repeat times
Generates a random times vector b
Generates a times random matrix R Solves R xr b Computes yr R xr
Theoretically, we should have yr b However, numerically the two quantities
will differ. Compute the relative error error er yr b b
Generates a times Hilbert matrix H Solves H xh b Computes yh H xh
Theoretically, we should have yh b However, numerically the two quantities
will differ. Compute the relative error error eh yh b b
Plots the ers and ehs obtained during the repetitions. You should obtain a plot
similar to the followin
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
