MATLAB Function Reference
  Go to function:
    Search    Help Desk 
polyval    Examples   See Also

Polynomial evaluation

Syntax

Description

y = polyval(p,x) returns the value of the polynomial p evaluated at x. Polynomial p is a vector whose elements are the coefficients of a polynomial in descending powers.

x can be a matrix or a vector. In either case, polyval evaluates p at each element of x.

[y,delta] = polyval(p,x,S) uses the optional output structure S generated by polyfit to generate error estimates, y±delta. If the errors in the data input to polyfit are independent normal with constant variance, y±delta contains at least 50% of the predictions.

Remarks

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

Examples

The polynomialis evaluated at x = 5, 7, and 9 with

which results in

For another example, see polyfit.

See Also

polyfit     Polynomial curve fitting

polyvalm    Matrix polynomial evaluation



[ Previous | Help Desk | Next ]