Help on eigenvector plot

1 Ansicht (letzte 30 Tage)
RuiQi
RuiQi am 2 Mär. 2015
Hello forum,
I am trying to plot the eigenvector of my dataset. This is my code
X = 0:0.01:1; Y = 5*X+randn(size(X)); Z = 0:0.005:0.5;
A = cat(1,X,Y,Z);
c = A*A.';
[vec,val] = eig(c);
plot3(A(1,:),A(2,:),A(3,:),'ro'); hold on
%sc_vec = vec*val;
z = zeros(1,3); plot3([z;vec(1,:)],[z;vec(2,:)],[z;vec(3,:)],'k')
axis equal grid on
If I were to use the scaled vectors, it would look like the figure below.
Can anyone help me on this ?

Antworten (0)

Kategorien

Mehr zu Operating on Diagonal Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by