Princomp has been removed. Use PCA instead.

15 vues (au cours des 30 derniers jours)
Mohamad Afiq
Mohamad Afiq le 2 Mar 2019
Réponse apportée : Sourabh le 18 Fév 2025
Hey guys. Can anyone help me convert the 'princomp' command to 'pca' ? Below are the coding.
pca_coeff{i} = princomp(feat');
pca_coeff{i} = pca_coeff{i}(:, 1:floor(size(feat,1)/2))';
In the MATLAB, it says that 'princomp has been removed. Use pca instead.'
Thank you. I'm very appreciate if there any answer from anyone.

Réponses (2)

Houhao Liang
Houhao Liang le 21 Nov 2019
Have you figured it out?

Sourabh
Sourabh le 18 Fév 2025
The “pca” function is a replacement for the “princomp” function that works in recent releases.
Replace the first line from
pca_coeff{i} = princomp(feat');
to
pca_coeff{i} = pca(feat');
I hope this helps!

Catégories

En savoir plus sur Deep Learning Toolbox dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by