# A question for principal components analysis (pca)

10 views (last 30 days)
Daniel Chou on 15 Feb 2021
Answered: Gaurav Garg on 22 Feb 2021
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.
Then perform the pca to the vertices.
[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 on 22 Feb 2021
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))