Replies: 1 comment
-
The returned To filter out complex values you can use functions like |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using the
math.eigs
function to compute all roots of a polynomial, with the eigenvalues of the companion matrix. However, I am only interested in real roots, and some values returned are complex. I can see all the roots withbut I can't find out how to isolate individual values, or to remove the complex values. This, for example:
returns an error. (So does
math.size
above.) So I have two questions: (1) how do I access individual eigenvalues, and (2) is there a built-in way of determining if a number is real or complex? (In my case, I could simply ask if the imaginary part of a value was less than the precision, of course.) In any case, I need to remove the complex values, leaving only reals.Thank you!
Beta Was this translation helpful? Give feedback.
All reactions