Skip to content

spline

polynomial · scripts/polynomial/spline.m

YI = spline (X, Y, XI)
PP = spline (X, Y)  --  cubic spline interpolation.

Not-a-knot end conditions are used, unless Y has two more entries than X:
then Y(1) and Y(end) are the end slopes of a clamped spline.  For three
points the interpolant is a parabola and for two points a line.  Y may be
an array whose last dimension matches X (array valued spline).  With two
arguments the pp-form structure is returned.