MATLAB Answers

0

what is the difference between pca(x) and princomp(x) matlab commands?

Asked by Mohamed Moawed on 3 Jun 2013
Latest activity Answered by Canadry Stinson on 26 Nov 2013

could any one help me the difference between pca(x) and princomp(x) matlab commands?

  0 Comments

Products

No products are associated with this question.

2 Answers

Answer by Tom Lane
on 3 Jun 2013
Edited by Tom Lane
on 6 Jun 2013
 Accepted answer

If you type "type princomp" you will see that it is just a call to pca with certain default inputs defined. The pca function was introduced just in an attempt to have a more familiar name.

  2 Comments

thanks for your reply. i want to ask is the input of the princomp is input matrix or covariance matrix? ans what about pca function is input matrix or covariance matrix?

Use pcacov if you have the covariance matrix. The others expect the data matrix.


Answer by Canadry Stinson on 26 Nov 2013

Besides from what Tom said, I want to add other difference between these two commands princomp lets you decide to do an economic version of the outputs. pca automatically truncates your matrix into an economic version.

  0 Comments


Join the 15-year community celebration.

Play games and win prizes!

Learn more
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

MATLAB Academy

New to MATLAB?

Learn MATLAB today!