Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Matlab, Engineering math The Hilbert matrix is a special n times n matrix whose (i, j)th entry is given by H_i, j = 1/(I +
Matlab, Engineering math
The Hilbert matrix is a special n times n matrix whose (i, j)th entry is given by H_i, j = 1/(I + j - 1) The Hilbert matrix becomes very poorly conditioned even for moderate values of n. For each n = 1, 2, 3, ..., 12 create the n times n Hilbert matrix H using the MATLAB command hilb (type help hilb to get information about the function). Create an exact solution x consisting of a column vector of n ones. Then create a right hand side b = Hx in MATLAB. Now solve Hx_c = b in MATLAB using the \ command so that xc = H\b Generally xc will not be exactly x due to rounding error. Compute the infinity norm of the error using the MATLAB function norm as follows: Err(n) = norm(x - xc, inf) and hence the relative error. Compute the condition number of H for each n using the MATLAB cond function. Print a nicely formatted table with three columns: n, the condition number, and the relative error in the solution. For n = 6 and 10 display the full solutions (ie all n entries in the vector x_c) to see how accurate are the solutionsStep 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