codepk
codepk

Reputation: 615

How to get eigen vectors given matrix and eigen values in Matlab?

I am writing my own function get eigen values and eigen vectors. I have used QR algorithm to extract eigen values. How do I get eigen vectors using diagonal eigen value matrix D and original matrix A?

Upvotes: 2

Views: 371

Answers (2)

David
David

Reputation: 8459

If you don't want to use eig, you can solve the matrix equation like so:

V=zeros(size(A));
for i=1:length(A)
    V(:,i)=null(A-eye(size(A))*D(i,i));
end

Upvotes: 4

nispio
nispio

Reputation: 1744

You don't need the eigenvalues in order to get the eigenvectors. Just use:

[V,D] = eig(A);

Upvotes: 0

Related Questions