polyval

Purpose

Polynomial evaluation.

Synopsis

y = polyval(p,S)

Description

y = polyval(p,S), where p is a vector whose elements are the coefficients of a polynomial in descending powers, is the value of the polynomial evaluated at S. If S is a matrix or vector, the polynomial is evaluated at each of the elements.

polyvalm(p,S), with S a matrix, evaluates the polynomial in a matrix sense. See polyvalm for more information.

Examples

The polynomial

is evaluated at s = 5 with

p = [3 2 1];
polyval(p,5)
which results in

ans =
     86
For another example, see polyfit.

See Also

conv, poly, polyfit, polyvalm, residue, roots

(c) Copyright 1994 by The MathWorks, Inc.