cspline(vx, vy) or cspline(Mxy, Mz)
pspline(vx, vy) or pspline(Mxy, Mz) lspline(vx, vy) or lspline(Mxy, Mz)
Return a vector which interp uses to create a cubic, piecewise polynomial
that passes through all the (x,y) data points. The piecewise polynomial has
continuous first and second derivatives for any value of x. The resultant spline
curve is either cubic (cspline), parabolic (pspline) or linear
(lspline) at the endpoints. These functions can also be used for two-dimensional
splines, where a surface that corresponds to a cubic polynomial in x
and y is passed through a grid of points in such a
way that the first and second derivatives of the surface are continuous across
each point in each direction.
interp(vs, vx, vy, x) or interp(vs, Mxy,
Mz, X) Returns a spline interpolated value of vy at
a point x using the output vector vs
from *spline. If the spline function has been used to fit a surface,
X is a 2-element vector at which to calculate the interpolated
z-value.
Arguments:
vx and vy are the vectors of real
data values with the same length. Elements of vx, the independent data, are in
ascending order.
Mxy is a real n x 2 array
of independent data specifying the x and y
coordinates along the diagonal of a rectangular grid. You must therefore have the same number of x and y values in your independent data points.
Mz is a real n x n array
of data. These are the z values corresponding to
x and y values in Mxy.
vs is a vector generated by cspline, pspline,
or lspline.
x is the real value of the independent variable
at which you want to evaluate the interpolation curve. For best results, this
should be in the range of values in vx.
X is the real, 2-element vector of values at which
you want to evaluate the interpolation surface.
Notes:
For x values before the first known data point,
the functions extrapolate the cubic section between the first two data points.
For x values beyond the last known data point, the
functions extrapolate the cubic section between the last two data points.
The first three values in vs are used by the interp
function. The remaining elements are the second-derivative coefficients.