polyvalΒΆ

polyval calculates the y coordinates of a polynomial of degree n evaluated at x.

y = polyval(p, x)

Return Value

y is a vector with y coordinates.

Parameters

p

p is a vector of length n+1 whose elements are the coefficients in descending powers of the polynomial to be evaluated:

P(x) = p_1x^n + p_2x^{n-1}+ \dotsb + p_{n}x + p_{n+1}

x

x is a vector with x coordinates.

Example

polyval([2,3], 0:5)
 3.0000     5.0000     7.0000     9.0000    11.0000    13.0000

History

Version Description
R2013.2 Documented.

id-2052800