Eigenvectors and the null function

I have a matrix D and I want to find eigenvectors using the null-function and known eigenvalues:
D = [2 -1;
-1 3];
eigs = eig(D);
q1 = null(D-eigs(1)*eye(2)) %first eigenvector
q2 = null(D-eigs(2)*eye(2)) %second eigenvector
The answer I get is 2×0 empty double matrix, however the eigenvectors should be
[q,l] = eig(D_tilde)
>> q =
-0.8507 -0.5257
-0.5257 0.8507
How do I get those values of eigenvectors?

답변 (1개)

Christine Tobler
Christine Tobler 2020년 4월 7일

0 개 추천

I'm getting those two eigenvectors when I copy your code into MATLAB:
>> D = [2 -1;
-1 3];
eigs = eig(D);
q1 = null(D-eigs(1)*eye(2)) %first eigenvector
q2 = null(D-eigs(2)*eye(2))
q1 =
0.8507
0.5257
q2 =
0.5257
-0.8507
But round-off errors can change between different versions and machines. Try passing a different tolerance as the second input to null, that should allow it to find an output x = null(M) even if M*x is larger than the default tolerance.

카테고리

도움말 센터File Exchange에서 Linear Algebra에 대해 자세히 알아보기

질문:

2020년 4월 7일

답변:

2020년 4월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by