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!