Display text string if eigenvalue is complex?
显示 更早的评论
Hi,
I am using the basic eigensolver function to compute the eigenvalues of matrix A and define them in matrix L as follows:
%Define value of A
A=input('Enter Values for Matrix "A" in form [a b;x y]:')
%Calculate eigenvalues of A
L=eig(A);
As any matrix which could produce complex eigenvalues is not a valid input for this scenario, I would like to be able to display a text string and return the user to a point at which matrix A can be redefined if a complex result is computed.
Any advice on how to do this would be greatly appreciated, this is my first foray into the world of Matlab.
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Eigenvalues & Eigenvectors 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!