- 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.
Why I'm getting different result while performing PCA with pca and princomp?
12 views (last 30 days)
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).
0 Comments
Answers (1)
Aditya
on 31 Jan 2025
Hi Hitesh,
I understand that you are facing issues with PCA and PRINCOMP.
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!