How to calculate eigenvectors without using eig
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposte (2)
Matt J
il 6 Feb 2019
Hint: use the null command to find non-zero solutions to the eigenvector equation.
4 Commenti
Angelo Yeo
il 6 Lug 2023
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)
v2 = v2 ./ norm(v2, 2)
3 Commenti
Steven Lord
il 9 Nov 2023
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)
v2 = v2 ./ norm(v2, 2)
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)
That looks good to me.
Walter Roberson
il 9 Nov 2023
The question is about calculation of eigenvectors knowing the eigenvalues
Vedere anche
Categorie
Scopri di più su Linear Algebra in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!