ppval
Evaluate piecewise polynomial
Syntax
v = ppval(pp,xq)
Description
v = ppval(pp,xq) evaluates the piecewise polynomial pp at the query points xq.
v = ppval(pp,xq) 评估查询点xq处的分段多项式pp。
Create Piecewise Polynomial with Polynomials of Several Degrees
Create a piecewise polynomial that has a cubic polynomial in the interval [0,4], a quadratic polynomial in the interval [4,10], and a quartic polynomial in the interval [10,15].
创建在区间[0,4]中具有三次多项式的分段多项式,区间[4,10]中的二次多项式,以及区间[10,15]中的四次多项式。
breaks = [0 4 10 15];
coefs = [0 1 -1 1 1; 0 0 1 -2 53; -1 6 1 4 77];
pp = mkpp(breaks,coefs)
Evaluate the piecewise polynomial at many points in the interval [0,15