Help me about matrix in Matlab ?
1 view (last 30 days)
Nguyen Trong Nhan on 30 Dec 2013
Give a square matrix A. For k is positive integer. Find k that A^k = 0. (I'm Vietnamese, I don't know How to call k in English). Could you please help me write the code to find k.
Thanks you very much.
Walter Roberson on 30 Dec 2013
There is in general no solution for this. If you do a singular value decomposition
[U,S,V] = svd(A);
then A = U * S * V' where S is a diagonal matrix, and A^k = U * S^k * V' . Then, A^k can only go to zero if S^k goes to 0. Algebraically that requires that the matrix be singular in the first place. In floating point arithmetic, it would require that the diagonal of the diagonal matrix S be all in (-1,+1) (exclusive on both ends) and then k would be the point at which the diagonal elements underflowed to 0. As the non-zero diagonal S entries of SVD are the square roots of the eigenvalues of A, this in turn requires that the eigenvalues are all strictly in the range (0,1) -- which is certainly not true for general matrices A.