How to calculate eigenvectors without using eig

I have a matrix, I need to get the eigenvectors. I already calculated the eigenvalues, Let's assume we have the eigenvalues, I wrote this
for i = 1:length(c)
syms y
cal_vec = (c-eig_Val(i)*I)*y == 0;
eigVec(:,i) = double(solve(cal_vec,y));
end
now I got zero as y, but I need to get y 1 and y2

回答 (2 件)

Matt J
Matt J 2019 年 2 月 6 日

0 投票

Hint: use the null command to find non-zero solutions to the eigenvector equation.

4 件のコメント

IDRIS Badmus
IDRIS Badmus 2019 年 2 月 6 日
can you explain further please, i don't understand what you mean
Matt J
Matt J 2019 年 2 月 6 日
編集済み: Matt J 2019 年 2 月 6 日
There is a Matlab command called null (documentation here) which will find vectors in the null space of a matrix.
Tyler Bilheimer
Tyler Bilheimer 2021 年 4 月 17 日
I dont understand where you're even supposed to put null in this
Matt J
Matt J 2021 年 4 月 18 日
編集済み: Matt J 2021 年 4 月 18 日
Well, the eigenvectors are by definition the null vectors of the matrix , so it should be straightforward to build that matrix and apply null() to it.

サインインしてコメントする。

Angelo Yeo
Angelo Yeo 2023 年 7 月 6 日

0 投票

Although this question is getting old, here is a sample solution to the question.
A=[2 1; 1, 2]; % 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 = 2×1
-0.7071 0.7071
v2 = v2 ./ norm(v2, 2)
v2 = 2×1
0.7071 0.7071

3 件のコメント

Syed Abdullah
Syed Abdullah 2023 年 11 月 9 日
You're still using eig builtin function.
Steven Lord
Steven Lord 2023 年 11 月 9 日
A=[2 1; 1, 2]; % A
lambdaA = [1, 3]; % Eigenvalues calculated earlier
% 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 = 2×1
-0.7071 0.7071
v2 = v2 ./ norm(v2, 2)
v2 = 2×1
0.7071 0.7071
Now, to check v1 and v2, let's call eig and compare the result of the code above with the "known" answer.
[V, D] = eig(A)
V = 2×2
-0.7071 0.7071 0.7071 0.7071
D = 2×2
1 0 0 3
That looks good to me.
Walter Roberson
Walter Roberson 2023 年 11 月 9 日
The question is about calculation of eigenvectors knowing the eigenvalues

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeLinear Algebra についてさらに検索

質問済み:

2019 年 2 月 6 日

コメント済み:

2023 年 11 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by