

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Due Date: See web page
[i] The following Matlab codes implement QR factorization using classical and modified Gram-Schmidt methods.
function [Q, R] = clgs(A)
[m,n] = size(A);
R = zeros(n,n); for j = 1:n v = A(:,j); for i = 1:j- R(i, j) = A(:,i)’A(:,j); v = v - R(i,j)A(:,i); end R(j,j) = norm(v); A(:,j) = v/norm(v); end Q = A;
function [Q, R] = mgs(A)
[m,n] = size(A); R = zeros(n,n); for j = 1:n for i = 1:j- R(i,j) = A(:,i)’A(:,j); A(:,j) = A(:,j) - R(i,j)A(:,i); end R(j,j) = norm(A(:,j)); A(:,j) = A(:,j)/R(j,j); end Q = A;
Using the vj and qj notation used in class and the projectors Pj = qj q∗ j , explain what operations are being implemented by the lines within the loops. For example, v = v - R(i,j)*A(:,i); in clgs corresponds to the subtraction of Pj vj from vj. Notice that the codes overwrite A. Using these codes, reproduce Figure 9.1 of the textbook.
[ii] Let D be the diagonal matrix (^)
Instead of taking the inner product of 3 dimensional vectors x and y to be x∗y as usual, define their inner product to be x∗Dy. Scale the vector
v =
by a positive number α to get q = αv such that q∗Dq = 1. Now q is the unit vector in the direction v under the inner product above. Write down the orthogonal projector in the direction v under the above inner product.
[iii] Let q 1 and q 2 be orthonormal m-dimensional vectors. Consider the following projectors:
Determine all the eigenvalues and eigenvectors of the three matrices above.
[iv] If A is an m × n matrix of rank 1, prove that it can be written as an outer product of an m-dimensonal vector with an n-dimensional vector.