pca function returns the wrong output in R2022a

7 次查看(过去 30 天)
Dear all,
I tried to use pca on 10x16 matrix. The function returned a 16x1 vector for coeff. According to the documentation it should be 16x16 matrix in my case. I figured, there must be something wrong with my input matrix, so I tried the example from the pca documentation page and got this:
load hald
>> coeff=pca(ingredients)
coeff =
517.7969
67.4964
12.4054
0.2372
Can there be something wrong with the pca function? Maybe its version issue. I am using R2022a.
Does anyone experience something similiar?

采纳的回答

Steven Lord
Steven Lord 2023-6-6
Let's check that you're using the pca function included in Statistics and Machine Learning Toolbox. What does this command show?
which -all pca
/MATLAB/toolbox/stats/stats/pca.m /MATLAB/toolbox/stats/bigdata/@tall/pca.m % tall method /MATLAB/toolbox/stats/gpu/@gpuArray/pca.m % gpuArray method
  6 个评论
Paul
Paul 2023-6-7
I didn't write it myself. It came with a repository that was left behind by a former colleague.
Paul
Paul 2023-6-7
I excluded the folder from my path. Now pca works as expected. Thanks for your help!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Dimensionality Reduction and Feature Extraction 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by