Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Part III. Matrix Factorization Difficulty Moderate Exercise 4 (4 points) In this

ID: 3281892 • Letter: P

Question

Part III. Matrix Factorization Difficulty Moderate Exercise 4 (4 points) In this exercise, you will work with a QR factorization of an m×n matrix. We will proceed in the way that is chosen by MATLAB, not by the author of our textbook. An m×n matrix A can be presented as a product of a unitary (or orthogonal) m×m matrix Q and an upper-triangular in × n matrix R, that is, A = Q *R T Q-0,or heory: a square mx m matrix Q is called unitary (or orthogonal) if equivalently, Q* -eye(m). It can be shown that the matrix A, R*Q is similar to A, that is A-AQ. It is known that similar matrices have the same sets of eigenvalues. For certain square matrices, such as, symmetrical, tridiagonal, Hessenberg matrices, the process of decomposing A into a product Q*R and interchanging the factors to create a matrix A, R*, then, repeating the process with the matrix A, (instead of A) to create the matrix A -R, and so on, produces a sequence of similar matrices A, A,A.. that converges to a matrix, which is close to an upper triangular matrix, and its diagonal entries approximate the eigenvalues of A. Note: QR is a powerful algorithm for finding the eigenvalues of certain matrices **Create a function in MATLAB function [] = quer (A) [m, n]-size (A) Part I: **Generate the first factorization by using the MATLAB in-built function Q,R]-qr (A) Output Q and R (do not put a semicolon after the command tQ,R]-qr (A)). **Then, your function has to verify that you did get the factorization, that is, check if the condition below holds closetozeroroundoff (A-*R) 0 If yes, output the message disp ('the product of Q and R forms a QR decomposition of A') If not, output something like disp ('No, it cannot be true!' The code for closetozeroroundoff is here: function B-closetozeroroundoff (A) [n, n] =size (A) ; for i=1:m

Explanation / Answer

Matlab code for qr factorization: