function polyroots
Return the roots of a polynomial. The polynomial is defined as P(x) = P[1] + P[2]*x + P[3]*x^2 + ... + P[n]*x^(n-1)
Syntax
result = polyroots(P [, derivative])
Arguments
P: | The polynomial |
derivative: | Optional, if an integer number is given, the nth derivative is returned. |
Returns
A vector with the roots (or derivatives of) the polynomial
Examples
Calculate the roots of the polynomias 1 + x^2 = 0:
print polyroots([1, 0, 1]), /values