A question for principal components analysis (pca)

조회 수: 14 (최근 30일)
Daniel Chou
Daniel Chou 2021년 2월 15일
답변: Gaurav Garg 2021년 2월 22일
Dear All,
I have a question about principal components analysis.
The scenario is,
I have a ellipsoid with semi major axis (length=1) and two equal length (=0.5) semi minor axes.
Despite I already know the magnitudes of three axes, I would like to try to use the pca command to find the magnitudes of semi_axes as well as the corresponding vectors.
The ellipsoid stl file in attached.
I use the stlread command to read this simple stl file.
Then perform the pca to the vertices.
T=stlread('ell.stl')
[coeff,score,latent,tsquared,explained,mu] =pca(T.Points)
I believe that the ''coeff'' matrix gives me three principal directions (the unit vectors of three semi axes) in terms of column vectors of the ellipsoid.
However, I don't know how to find the ''magnitude of semi axes'' (i.e. max_principal value=1, other tow=0.5) of this ellipsoid from pca data.
After I refer the documentation of pca command, I still fail to find the information could answer my question.
Could anyone give me the hint about it?
Really appreciate for that!!!
Sincerely
Daniel Chou

채택된 답변

Gaurav Garg
Gaurav Garg 2021년 2월 22일
Hi Daniel,
plot (score(:,1), score(:,2))
On running the above function, you will find a 2-D ellipse which has magnitude same as the magnitude of the original 3-D ellipsoid.
You can also plot the other principal axis by -
plot (score(:,1), score(:,3))
plot (score(:,3), score(:,2))

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by