Help on eigenvector plot
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Operating on Diagonal Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!