Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Cubic spline interpolation with end conditions

`pp = csape(x,y)`

`pp = csape(x,y,conds)`

`pp = csape(x,[e1,y,e2],conds)`

`pp = csape({x1,...,xn},___)`

returns the cubic spline interpolation to the given data `pp`

= csape(`x`

,`y`

)`(x,y)`

in ppform
form. The function applies Lagrange end conditions to each end of the data, and matches the
spline endslopes to the slope of the cubic that fits the last four data points at each end.
Data values at the same site are averaged.

returns the cubic spline interpolation for gridded data using the univariate mesh inputs
`pp`

= csape({x1,...,xn},___)`x1,...,xn`

. In this case, `y`

is an
`n+r`

-dimensional array, where `r`

is the dimensionality
of each data value. `conds`

is a cell array with `n`

entries, which provides end conditions for each of the `n`

variables. In
some cases, you must supply end conditions for end conditions. You can use this syntax with
any of the arguments in the previous syntaxes.

The relevant tridiagonal linear system is constructed and solved using the sparse matrix
capabilities of MATLAB^{®}.

The `csape`

command calls on a much expanded version of the Fortran
routine `CUBSPL`

in *PGS*.