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.

댓글 수: 4

Roger Stafford
Roger Stafford 2013년 12월 30일
편집: Roger Stafford 2013년 12월 30일
If A is a non-singular square matrix - that is, if it possesses an inverse - then no finite value of k can ever satisfy your condition. You seem to have posed an impossible problem. Are you sure this is what you meant to ask?
Nguyen Trong Nhan
Nguyen Trong Nhan 2013년 12월 30일
편집: Nguyen Trong Nhan 2013년 12월 30일
yes, I meant that.please help me .
Image Analyst
Image Analyst 2013년 12월 30일
You said "Give a square matrix A". Well how about if I give you an A that is all zeros?
Roger, it can happen in floating point arithmetic, though not algebraically. For example,
diag(rand(1,5))
raised to a large enough power will underflow to all 0's.
For example,
A = diag([0.757740130578333, 0.743132468124916, 0.392227019534168, 0.655477890177557, 0.171186687811562]);
is last non-zero at A^2685

댓글을 달려면 로그인하십시오.

 채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 30일

0 개 추천

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.

댓글 수: 1

Roger Stafford
Roger Stafford 2013년 12월 30일
편집: Roger Stafford 2013년 12월 30일
No, that isn't true for 'svd' in general, Walter. It does hold true for 'eig' when it can obtain a complete set of orthogonal eigenvectors and eigenvalues.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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

제품

태그

Community Treasure Hunt

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

Start Hunting!

Translated by