function C = pca(A,eigen) m = mean(A')'; A = A - m*ones(1,size(A,2)); [U,S,V] = svd(A,0); U = U(:,1:5); S = S(1:5,1:5); V = V(:,1:5); C = S*V'; % For testing, remove when correct eyeball(C,U,A,eigen);