Assume that you have a matrix $X$ and you want to compute the complex eigenvectors. You only know the complex eigenvalues.
With that information, you could solve the null space formula $$(A-\lambda I)v = 0$$
With this MATLAB code
% Create a matrix
A = [2 3 1;
4 1 -3;
2 0 4];
% Compute the eigenvalues
[~, eigenvalues] = eig(A, 'vector')
% Iterate the eigenvalues to compute the eigenvectors
eigenvectors = [];
for i = 1:length(eigenvalues)
eigenvalue = eigenvalues(i)
V = null(A - eigenvalue * eye(size(A))); % (A - λ*I)v = 0
eigenvectors = [eigenvectors V];
end
We print the eigenvectors
0.5718 + 0i -0.4879 - 0i -0.4879 - 0i
-0.8014 + 0i -0.3148 - 0.3824i -0.3148 + 0.3824i
-0.1756 + 0i -0.4002 + 0.5971i -0.4002 - 0.5971i
We can always to a check if (A - λ*I)v is actully zero
% (A - λ*I)v = 0
(A - eigenvalues(1) * eye(size(A)))*eigenvectors(:, 1)
% Output:
-2.4147e-15
1.0270e-15
5.7825e-16
This eigenvector corresponds to the eigenvalue -2.5116 and MATLAB's D = eig(X) function give the same result.
0.5718
-0.8014
-0.1756
The rest of the eigenvectors in MATLAB gives[V, ~] = eig(X) gives.
0.5718 + 0i -0.2716 - 0.4053i -0.2716 + 0.4053i
-0.8014 + 0i 0.1424 - 0.4744i 0.1424 + 0.4744i
-0.1756 + 0i -0.7188 + 0i -0.7188 - 0i
Question:
Notice that I'm using null command to solve for the null vector. Is it possible for me to use QR factorization instead of null to solve the null vector? If yes, how?