Z=csvread('glass data short noclass.csv');
[rows,cols]=size(Z);
disp([rows,cols])
sig=cov(Z);
%sig=corrcoef(Z);
[V,D]=eig(sig);
eigenvals=sort(diag(D),'descend');
norm=sum(eigenvals);
disp(norm)
pov=cumsum(eigenvals)/norm;
disp([eigenvals,pov])
figure(1)
plot(eigenvals)
hold on
plot(pov)
hold off
for i=1:rows
    xt=Z(i,:);
    z1(i)=xt*V(:,9);
    z2(i)=xt*V(:,8);
end
figure(2)
plot(z1,z2,'*')