MATLAB: Isn’t eig returning all eigenvectors

eiglinearly dependent

I have a matrix in Matlab, that can be created by the following commands
c = 3; t = 3; l = 4;
A = [l*ones(c), -ones(c,t*l); -l*ones(t*l,c), kron(eye(l), l*ones(t))];
By the special block structure of A and for given parameter values c,t,l, the eigenvalue 0 should appear with multiplicity 11. This is also what I get when I compute the dimension of the nullspace of A:
size(null(A))
ans =
15 11
Now, I use eig to calculate all eigenvalues and eigenvectors of A. The eigenvalue 0 appears with multiplicity 11, too:
[V,D] = eig(A);
d = diag(D); [d,I] = sort(d); V = V(:,I); %sort eigenvalues in ascending order and rearrange eigenfunctions accordingly
transpose(d)
ans =
-0.0000 -0.0000 0 0 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 12.0000 12.0000 12.0000 24.0000
That means that the first 11 columns of V are now the eigenvectors of the eigenvalue 0. However, my problem is that the eigenfunctions of the eigenvalue 0 are linearly dependent, i.e.
rank(V(:,1:11))
ans =
8
So why did eig only return 8 linearly independent vectors, even though there are 11? Of course I could just use null(A), to obtain all eigenvectors, but I try to understand the behavior of eig.

Best Answer

When you have multiple-order eigen value(s), the number of eigen vectors is not necessary equal to the order.
Much simpler example is:
A=[0 1;
0 0]
Only [1; 0] is eigen vector .
You can read about Jordan-form to better understand about the "eigen-classification" of matrices.
Caveat: Jordan form calculation is unstable wrt numerical errors, so the result might vary when you do numerical calculation such as RANK, EIG, etc... But it explains why the number of eigen vectors returned are some time dependent when the matrix has multiple-order eigen value(s).