We want to explore the accuracy of MATLABs solution to the following set of equations for values

Question:

We want to explore the accuracy of MATLAB’s solution to the following set of equations31 6 3 31 2 3 2+ H X1 X2 X3 7 10 8

for values of ϵ from 10−1 to 10−15. For this problem, you are allowed to use the slash command to solve the system of equations and the cond function to compute the condition number.

Write a MATLAB function that computes the condition number and the relative error in the value of x3 as a function of ϵ. The error in x3 should be computed by the formulaerror = compute |x3 rexact 3 xexact

where x3compute is the value obtained in MATLAB and x3exact is the exact solution for x3 that you obtained by solving this system by hand using Gauss elimination. Your program should make (i) a log–log plot of the condition number versus epsilon and (ii) a log–log plot of the relative error versus the condition number.

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: