Last active
August 29, 2015 14:17
-
-
Save lettergram/d5ec3970ac4aa4f3e30d to your computer and use it in GitHub Desktop.
PCA Function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% 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