|
Contents | Previous | Next | Subchapters |
| Syntax |
polyval(p, x) |
| See Also | polval , poly |
n-1 1
p[x ] = p x + ... + p x + p
i,j 1 i,j n-1 i,j n
where n is the length of the vector p.
The integer, real, double-precision, or complex vector
p specifies the polynomial to be evaluated.
The integer, real, double-precision, or complex matrix
x specifies the points at which to evaluate the polynomial.
The return matrix has the same dimension as x
and the same type as a binary operation between p and x.
(See the coercion
entry in the O-Matrix User's Guide.)
p = [-1, 0, 1]
x = -2. : .1 : +2.
v = polyval(p, x)
gplot(x, v)
returns the following plot: