matrixForDataPoints
Evaluate terminated B-spline basis functions and optional derivatives.
Declaration
B = matrixForDataPoints(dataPoints, options)
Parameters
dataPointspoints at which to evaluate the splinesoptions.knotPointsspline knot pointsoptions.Sspline degreeoptions.D(optional) number of spline derivatives to return, max(D)=S
Returns
Barray of sizenumel(dataPoints) x M x (D+1)whereM = numel(knotPoints) - S - 1
Discussion
Use this to assemble a design matrix for interpolation, regression, or direct inspection of the basis functions.
For D=0, the returned matrix satisfies
When D > 0, slice B(:,:,d+1) stores the basis values for derivative order d, so B(:,:,d+1) * xi evaluates the dth derivative at dataPoints.
B = BSpline.matrixForDataPoints(t, knotPoints=knotPoints, S=3);
xi = B \ x;
spline = BSpline(S=3, knotPoints=knotPoints, xi=xi);