% Matlab diary from cs111, Nov 14 2007. % % This is what I typed in class. % % Type it into Matlab yourself to % reproduce the output I showed. diary on Q = eye(5) Q' Q'*Q clc A = randn(5) [L,U,P]=lu(A) P' * P Q = randq(5) Q'*Q format long Q'*Q Q eye(5) A = randn(2) eigshow(A) Q Q = randq(2) eigshow(Q) eigshow(Q) Q = randq(2) eigshow(Q) Q = randq(2) eigshow(Q) Q = randq(2) eigshow(Q) Q Q'*Q Q(:,1) = -Q(:,1) eigshow(Q) Q(:,1) = -Q(:,1) eigshow(Q) Q = randq(5) x = rand(5,1) format short x norm(x) norm(Q*x) norm(x) - norm(Q*x) norm(x) norm(Q*x) norm(x,1) norm(Q*x,1) A = randn(5,3) [Q,R] = qr(A) Q'*Q clc X = A X clc A qrsteps(A) A qrsteps(A) edit randq clc A = randn(5) [Q,R] = qr(A) diary off