FUNCTION REFERENCE

spline

Cubic spline interpolation (not-a-knot end conditions).

Cubic spline interpolation (not-a-knot end conditions).

Syntax

yy = spline(x, y, xx)

Syntax

pp = spline(x, y)

x and y are vectors of the same length. Values outside the data range are

extrapolated by the end polynomial. Two points give a line, three a parabola.

With two inputs the result is the piecewise polynomial structure for ppval.

Example

spline([0 1 2 3], [0 1 8 27], [0.5 1.5])   % [0.125 3.375]

Example

pp = spline(0:3, [0 1 8 27]); ppval(pp, 1.5)   % 3.375

Differences from MATLAB: matrix y and clamped end slopes are not supported

yet. The structure always has order 4 with a piece between each pair of sites.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.