Main Content


Extract piecewise polynomial details



[breaks,coefs,L,order,dim] = unmkpp(pp) extracts information from the fields of the piecewise polynomial structure pp.


collapse all

Create a piecewise polynomial structure for the polynomial f(x)=x2+x+1 on the interval [0 3], and then extract the information from the fields of the structure.

pp = mkpp([0 3],[1 1 1])
pp = struct with fields:
      form: 'pp'
    breaks: [0 3]
     coefs: [1 1 1]
    pieces: 1
     order: 3
       dim: 1

[breaks,coefs,L,order,dim] = unmkpp(pp)
breaks = 1×2

     0     3

coefs = 1×3

     1     1     1

L = 1
order = 3
dim = 1

Input Arguments

collapse all

Piecewise polynomial, specified as a structure. You can create pp using spline, pchip, interp1, or the spline utility function mkpp.

Output Arguments

collapse all

Break points, returned as a vector of length L+1 with strictly increasing elements that represent the start and end of each of L intervals.

Polynomial coefficients, returned as an L-by-k matrix with each row coefs(i,:) containing the local coefficients of an order k polynomial on the ith interval, [breaks(i),breaks(i+1)].

Number of intervals, returned as a scalar.

Order of polynomials, returned as a scalar.

Dimension of target, returned as a scalar or vector.

Extended Capabilities

Version History

Introduced before R2006a

See Also

| | |