powered by
Evaluate a polynomial at given points.
polyval(coef, z)
An array of length(z), the polynomial evaluated at each element of z.
length(z)
z
coefficients of the polynomial, defined in decreasing power.
the points at which to evaluate the polynomial.
Tom Short
poly, roots
poly
roots
polyval(c(1, 0, -2), 1:3) # s^2 - 2
Run the code above in your browser using DataLab