Calculating separate eigenvectors manually
显示 更早的评论
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!
回答(1 个)
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)
v2 = v2 ./ norm(v2, 2)
1 个评论
Christine Tobler
2023-7-5
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Linear Algebra 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!