Calculating separate eigenvectors manually

12 views (last 30 days)
Hello all,
I am trying to calculate the eigenvectors for the system and I am struggling, the code is as follows:
A=[2 -2i;2i 5]; % A
lambdaA = round(eig(A)); % Finds values of A
setup1=A-(eye(2)*lambdaA(2,:)); % setting up to produce eigenvectors
Zmatrix=zeros(2,1); % Zeros
W=linsolve(setup1,Zmatrix)
The could is attempting to set up:
[-4 -2i; 2i -1]*[x;y]=[0;0]
to solve for x and y and place that into W
We know the answer to be:
Any help would be greatly appreciated! Thank you in advance!

Answers (1)

Angelo Yeo
Angelo Yeo on 5 Jul 2023
linsolve cannot provide what you want because where λ is an eigenvalue becomes singular.
Instead, you need to think of how to get the nullspace of . In MATLAB, you can use the function null.
A=[2 -2i;2i 5]; % A
lambdaA = round(eig(A)); % Finds values of A
% Note that "rational" option is used otherwise SVD is used in the
% calculation.
v1 = null(A - lambdaA(1) * eye(2), "rational");
v2 = null(A - lambdaA(2) * eye(2), "rational");
v1 = v1 ./ norm(v1, 2)
v1 =
0.0000 + 0.8944i 0.4472 + 0.0000i
v2 = v2 ./ norm(v2, 2)
v2 =
0.0000 - 0.4472i 0.8944 + 0.0000i
  1 Comment
Christine Tobler
Christine Tobler on 5 Jul 2023
I agree with Angelo's solution. Just a quick remark to clarify: This is a good way to learn how the eigenvectors and eigenvalues are connected.
In a practical numerical application, it would be preferrable to call [U, D] = eig(A) which returns both the eigenvalues and the eigenvectors.
The "rational" option also makes sense pedagogically, but the standard call to null that uses the svd is preferable numerically.

Sign in to comment.

Categories

Find more on Linear Algebra 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!