% This is a plotting file for # 2a of HW 11.
% You need to run  hw11_p1.m  first to initiate matrix M=H^T H.

[EIGVECS,EIGVALS]=eig(M);            % Compute the eigenvectors and eigenvalues of M.
                                     % Note that the eigenvalues are listed in the
                                     %  increasing order.
EIGVALS=diag(EIGVALS)                % List the eigenvalues in a convenient form (as a column).                                     

figure(11);
subplot(3,1,1); plot(EIGVECS(:,end))  % Plot the eigenvector corresponding to the largest eigenvalue
                                      %  in the first panel of the figure.
subplot(3,1,2); plot(EIGVECS(:,end-1))% Plot the eigenvector corresponding to the second-largest 
                                      %  eigenvalues, in the 2nd panel of the figure.
subplot(3,1,???);  ???                % Modify the previous command to plot the eigenvector corresponding
                                      %  to the next largest eigenvalues, in the 3rd panel of the figure.
               
figure(21);
subplot(3,1,1); plot(EIGVECS(:,3))    % Plot the eigenvector corresponding to the 3rd smallest eigenvalue
                                      %  in the first panel of the figure.
??; ??                                % Modify the previous command to plot the eigenvectors corresponding
                                      %  to the 2nd and 1st smallest eigenvalues in their respective panels.
??; ??
