|MATLAB Function Reference|
Evaluate piecewise polynomial.
v = ppval(pp,xx)
returns the value at the points
xx of the piecewise polynomial contained in
pp, as constructed by
spline or the spline utility
v = ppval(xx,pp)
returns the same result but can be used with functions like
quad that take a function as an argument.
Compare the results of integrating the function
with the results of integrating the piecewise polynomial
pp that approximates the cosine function by interpolating the computed values
int1 provides the integral of the cosine function over the interval
int2 provides the integral over the same interval of the piecewise polynomial