
C = [[64,-25]; [-25,64]];
[u,v] = eig(C);

p = load('ps1.dat');

sp = size(p);
q = zeros(sp);
for i = 1:sp(1)
    q(i,1) = p(i,:)*u(:,1);
    q(i,2) = p(i,:)*u(:,2);
end

q = q';
p = p';

subplot(211)
scatter(p(1,:),p(2,:))
axis([-40,40,-40,40])
title('Original Data')
xlabel('x')
ylabel('y')
subplot(212)
scatter(q(1,:),q(2,:))
axis([-40,40,-40,40])
title('Transformed Data')
xlabel('first eigenvector')
ylabel('second eigenvector')    


