Help on eigenvector plot
1 view (last 30 days)
Show older comments
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 ?
0 Comments
Answers (0)
See Also
Categories
Find more on Operating on Diagonal Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!