% % Written by: % -- % John L. Weatherwax 2005-08-04 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % % Epage % %----- close all; clc; clear; X = [ 1, 2; 2, 1; 1, 3 ]; X' * X X * X' [xtx_evec,xtx_eval] = eig( X' * X ) [xxt_evec,xxt_eval] = eig( X * X' ) % One has to match the eigenvectors of X X^H and X^H X to use in the inner product % by the eigenvalues each one has. % Xhat = sqrt(xtx_eval(2,2)) * ( xxt_evec(:,3) * (xtx_evec(:,2)') ) + ... sqrt(xtx_eval(1,1)) * ( xxt_evec(:,2) * (xtx_evec(:,1)') )