pp = mkpp(breaks, coefs)
pp = mkpp(breaks, coefs, d)
| Parameter | Description |
|---|---|
| breaks | Vector of break points, of length pieces + 1. |
| coefs | Matrix of polynomial coefficients, of size (pieces * prod(d)) by order. Each row holds the coefficients of one polynomial piece from the highest power to the constant term. |
| d | Dimension of the values of the piecewise polynomial (default 1). |
| Parameter | Description |
|---|---|
| pp | Piecewise polynomial structure with fields form, breaks, coefs, pieces, order and dim. |
mkpp builds a piecewise polynomial structure from its break points and coefficients. The structure can then be evaluated with ppval.
For each piece, the polynomial is evaluated in the local variable x - breaks(i), where breaks(i) is the left break point of the piece.
The number of pieces is numel(breaks) - 1 and the order is the number of columns of coefs.
pp = mkpp([0 1 2], [1 0; 1 1]);
ppval(pp, 0.5)