May I ask what is the definition of Nilpotent matrix. I suppose that is A^k =0 for some k? If I am right, then 0 must be an eigenvalue of A, then there is some issues for the test problems.
@Ling Liang , take some tolerance while checking the equality of eigen value with zero.
3924 Solvers
262 Solvers
518 Solvers
Check if number exists in vector
4714 Solvers
149 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!