Problem in calculating Principal Component Analysis
1 view (last 30 days)
Show older comments
I am not able to calculate Principal Components of a RGB image without converting it into Gray image,whenever i use princomp function on it, it shows following error :-
Undefined function or method 'svd' for input arguments of
type 'double' and attributes 'full 3d real'.
Error in ==> princomp at 73 [ignore,ignore,coeff] = svd(x0,econFlag);
Please help me out
0 Comments
Answers (1)
Thomas
on 6 Apr 2012
princomp performs PCA only on 2D matrices, I'm assuming your image is a 3D matrix of form n x p x m.
doc princomp
princomp(X) performs principal components analysis (PCA) on the n-by-p data matrix X, and returns the principal component coefficients, also known as loadings. Rows of X correspond to observations, columns to variables. COEFF is a p-by-p matrix, each column containing coefficients for one principal component.
here is a link to a similar problem
0 Comments
See Also
Categories
Find more on Dimensionality Reduction and Feature Extraction in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!