Skip to content

Instantly share code, notes, and snippets.

@lettergram
Last active Aug 29, 2015
Embed
What would you like to do?
PCA Function
% Find score matrix for PCA %
% Outputs score between column s and e %
function W = PCA(matrix, s, e)
[U,S,V] = svd(matrix * transpose(matrix));
T = U * sqrt(S);
T = W(:,s:e);
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment