polyval

Evaluate a polynomial.

Syntax

y = polyval(p,x)

y = polyval(p,x,[],mu)

Inputs

p
The coefficients of the polynomial to be evaluated, in descending order.
Dimension: vector
x
The values at which to evaluate the polynomial.
Dimension: scalar | vector | matrix
mu
Shift and scale factors to evaluate the polynomial for (x-mu(1))/mu(2).
Dimension: vector

Outputs

y
The evaluated polynomial values.

Example

Evaluate x^2 + 5x + 6 at various values.

y = polyval([1,5,6],[0,1,2,3,4,5])
y = [Matrix] 1 x 6
6  12  20  30  42  56