Eigenvector different to expected using eig
조회 수: 11 (최근 30일)
이전 댓글 표시
Hello! The problem is as the title suggests.
A=[1.5 -0.5; -1 1];
[Vec,Val]=eig(A)
The outputted eigenvalues are 2 and 0.5
The outputted eigenvectors are: [0.7071 0.4472; -0.7071 0.8944]
The expected eigenvectors from calculations are (1 2) and (1 -1)
Anyway I can get the expected values ?
댓글 수: 0
채택된 답변
Steven Lord
2021년 3월 4일
A=[1.5 -0.5; -1 1];
[Vec,Val]=eig(A)
What does the eig function return? From its documentation: "[V,D] = eig(A) returns diagonal matrix D of eigenvalues and matrix V whose columns are the corresponding right eigenvectors, so that A*V = V*D." So is A*V close to V*D?
format longg
A*Vec-Vec*Val
Yeah, those are pretty close to 0. How about for your matrix of eigenvectors?
Vec2 = [1 1; 2 -1]
A*Vec2-Vec2*Val
Perhaps, from the orientation of your eigenvectors, you're trying to use the left eigenvectors? "[V,D,W] = eig(A) also returns full matrix W whose columns are the corresponding left eigenvectors, so that W'*A = D*W'."
[Vec, Val, VecLeft] = eig(A);
VecLeft
VecLeft'*A - Val*VecLeft'
Vec2'*A-Val*Vec2'
Still no. So please show me why you believe that the columns of Vec2 are eigenvectors for this matrix.
If we scaled VecLeft a bit it looks a little similar to your Vec2 matrix but not exactly.
VecLeftScaled = VecLeft ./ VecLeft(2, :)
VecLeftScaled'*A-Val*VecLeftScaled'
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!