%% Homework template for the Matlab part of 6.3: % Here is an 8 x 4 matrix U (Exercise 35, Section 6.2) U=[-6 -3 6 1 -1 2 1 -6 3 6 3 -2 6 -3 6 -1 2 -1 2 3 -3 6 3 2 -2 -1 2 -3 1 2 1 6]; %% Our formulas are only valid for columns with o.n. columns: % (in class) Compute U^T U U'*U % (in class) What does this tell you about the columns of U? % Answer: The columns are orthogonal- They would be o.n. if we divide by % 10. There may be numerical round off error: U=U/10; U'*U %% (#25, 6.3) Find the distance between y given below and Col(U) y=ones(8,1); %% (#26, 6.3) Addition: Find the projection of b onto Col(U), then find % the distance between b and col(U) b=[ones(4,1); -ones(4,1)];