User`s guide

3 Fitting Data
3-72
Example: Nonparametric Fit
This example fits the following data using a cubic spline interpolant and
several smoothing splines.
rand('state',0);
x = (4*pi)*[0 1 rand(1,25)];
y = sin(x) + .2*(rand(size(x))-.5);
As shown below, you can fit the data with a cubic spline by selecting
Interpolant from the Type of fit list.
The results shown below indicate that goodness of fit statistics are not defined
for interpolants.
As described in Interpolants on page 3-68, cubic spline interpolation is
defined as a piecewise polynomial that results in a structure of coefficients. The
number of pieces in the structure is one less than the number of fitted data
points, and the number of coefficients for each piece is four because the
polynomial degree is three. The toolbox does not allow you to access the
structure of coefficients.