Write a MATLAB functionthat computes the trace of matrixTest to make sureis a square matrix.
Use tr to compute the trace for the matrix of Problem 1.9 and the Hilbert matrix of order 15 (Problem 1.28). Verify your result by using the MATLAB command trace.
Problem 1.9
TheHilbert matrices are defined byFor instance, here is theHilbert matrix.
Systems of the formwhereis a Hilbert matrix are notoriously difficult to solve because they are illconditioned. This means that a solution can change widely with only a small change in the elements oforChapter 10 discusses ill-conditioned matrices. The MATLAB command hilb builds anHilbert matrix. For instance to find theHilbert matrix, execute
a. The command format shortg causes output of the best of fixed or floating point format withdigits. Using this format, compute the inverse of theHilbert matrix. What makes you suspicious that it is ill-conditioned?
b. The exact inverse of any Hilbert matrix consists entirely of integer entries. Using the Symbolic Toolbox will provide an exact answer. If your MATLAB distribution has this software, use the help system to determine how to use the commands syms and sym. Determine the exact value of−1
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here