## Documentation Center |

Make piecewise polynomial

`pp = mkpp(breaks,coefs)pp = mkpp(breaks,coefs,d)`

`pp = mkpp(breaks,coefs)` builds
a piecewise polynomial `pp` from its breaks and coefficients. `breaks` is
a vector of length `L+1` with strictly increasing
elements which represent the start and end of each of `L` intervals. `coefs` is
an `L`-by-`k` matrix with each row `coefs(i,:)` containing
the coefficients of the terms, from highest to lowest exponent, of
the order `k` polynomial on the interval `[breaks(i),breaks(i+1)]`.

`pp = mkpp(breaks,coefs,d)` indicates
that the piecewise polynomial `pp` is `d`-vector
valued, i.e., the value of each of its coefficients is a vector of
length `d`. `breaks` is an increasing
vector of length `L+1`. `coefs` is
a `d`-by-`L`-by-`k` array
with `coefs(r,i,:)` containing the `k` coefficients
of the `i`th polynomial piece of the `r`th
component of the piecewise polynomial.

Use `ppval` to evaluate
the piecewise polynomial at specific points. Use `unmkpp` to extract details of the piecewise
polynomial.

**Note.** The *order* of
a polynomial tells you the number of coefficients used in its description.
A *k*th order polynomial has the form

It has *k* coefficients, some of which can
be 0, and maximum exponent *k – *1. So the
order of a polynomial is usually one greater than its degree. For
example, a cubic polynomial is of order 4.

Was this topic helpful?