Contents Previous Next Subchapters

Evaluating A Polynomial
Syntax polval(px)
See Also polyval , pol2asc , zero2pol

Description
Returns the evaluation of the polynomial corresponding to p at each of the elements of x. The (i,j)-th element of the return value is
                                   2                  n-1
     p[x   ] = p  +  p  x    + p  x    + . . . +  p  x
        i,j     1     2  i,j    3  i,j             n  i,j
where n is the length of the vector p. The integer, real, double-precision, or complex column 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.)

Example
     p = {-1, 0, 1}
     x = -2. : .1 : +2.
     v = polval(p, x)
     gplot(x, v)

returns the following plot: