Eigenvector different to expected using eig

조회 수: 11 (최근 30일)
Joshua Tsui
Joshua Tsui 2021년 3월 4일
댓글: Joshua Tsui 2021년 3월 4일
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 ?

채택된 답변

Steven Lord
Steven Lord 2021년 3월 4일
A=[1.5 -0.5; -1 1];
[Vec,Val]=eig(A)
Vec = 2×2
0.7071 0.4472 -0.7071 0.8944
Val = 2×2
2.0000 0 0 0.5000
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
ans = 2×2
0 2.77555756156289e-17 0 0
Yeah, those are pretty close to 0. How about for your matrix of eigenvectors?
Vec2 = [1 1; 2 -1]
Vec2 = 2×2
1 1 2 -1
A*Vec2-Vec2*Val
ans = 2×2
-1.5 1.5 -3 -1.5
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 = 2×2
0.894427190999916 0.707106781186547 -0.447213595499958 0.707106781186547
VecLeft'*A - Val*VecLeft'
ans = 2×2
0 0 0 0
Vec2'*A-Val*Vec2'
ans = 2×2
-2.5 -2.5 2 -1
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 = 2×2
-2 1 1 1
VecLeftScaled'*A-Val*VecLeftScaled'
ans = 2×2
0 0 0 0
  댓글 수: 1
Joshua Tsui
Joshua Tsui 2021년 3월 4일
Thankyou Steven. It appears, I read my textbook incorrectly. I mistook the arbitary relationships as vectors.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Resizing and Reshaping Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by