Why does the pca function in MatLab and on mathworks indicate different outputs?

조회 수: 2 (최근 30일)
I am trying to run a simple pca on a data set using as indicated below as part of a function
[~, scores, ~]= pca(X)
However, I keep getting the following error
Error using pca (line 151)
Input NCOMP is missing. Type: 'help pca'
Error in function (line 22)
[~, scores, ~]=pca(X);
It won't format the outputs how I want them. Does this have something to do with the fact I have PLStoolbox?

채택된 답변

Steven Lord
Steven Lord 2021년 6월 22일
You have a different pca.m that is taking precedence over the pca function included in Statistics and Machine Learning Toolbox. In release R2019b line 151 is a comment listing one of the references for the function. To confirm this look at the output of this command:
which -all pca
  댓글 수: 2
Adam Rish
Adam Rish 2021년 6월 22일
How do I switch to the preferred/deisred function?
Steven Lord
Steven Lord 2021년 6월 22일
I would ask the author of the other function(s) why they're shadowing the function from Statistics and Machine Learning Toolbox and probably suggest they move their function into a class or package folder.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by