Display text string if eigenvalue is complex?
Show older comments
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.
Accepted Answer
More Answers (0)
Categories
Find more on Eigenvalues & Eigenvectors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!