Why I'm getting different result while performing PCA with pca and princomp?
Show older comments
[c,s,l] = princomp(x);
[c,s,l] = pca(X);
% First Command returns with complete i*j but Second returns i*(j-1).
Answers (1)
Aditya
on 31 Jan 2025
0 votes
Hi Hitesh,
I understand that you are facing issues with PCA and PRINCOMP.
- Use pca: It is the recommended method for PCA in MATLAB, offering better performance and more options.
- Check Data: Ensure your data is well-prepared and free of NaNs unless you are using options to handle them.
- Understand Output: Be aware of the default behavior regarding the number of components returned, and adjust using options if necessary.
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!