
tt = load('ps1.txt')

% original correlation
ttcorr = corrcoef(tt(1,:), tt(2,:))
figure
plot(tt(1,:),tt(2,:),'.')
xlabel('x')
ylabel('y')

% eigenvector  
% A = [37 -15; -15 37]
% [V,D] = eig(A)
 V =[ 0.7071   0.7071
     -0.7071   0.7071]
 
zz = V'*tt; % axis transformation

% correlation after transformation
zzcorr = corrcoef(zz(1,:), zz(2,:))
figure
plot(zz(1,:),zz(2,:),'.')
xlabel('first eigenvector')
ylabel('second eigenvector')

