matrixForPointMatrix
Evaluate the tensor-product basis matrix and optional derivatives.
Declaration
B = matrixForPointMatrix(pointMatrix, options)
Parameters
pointMatrixquery locations as a point matrixoptions.knotPointsknot vector in 1-D or cell array of knot vectorsoptions.Sspline degree scalar or vector with one entry per dimensionoptions.Dderivative order per dimension
Returns
Bbasis matrix with one row per query point
Discussion
Use this to assemble a tensor-product design matrix for interpolation, regression, or basis inspection.
If pointMatrix has rows x_i, then row i of the returned matrix is the Kronecker product of the one-dimensional basis rows evaluated at x_i. In other words,
where each factor is the one-dimensional basis row in one coordinate direction, optionally replaced by its derivative row.
[Xq, Yq] = ndgrid(xq, yq);
B = TensorSpline.matrixForPointMatrix([Xq(:), Yq(:)], knotPoints=knotPoints, S=[3 3]);
values = B * spline.xi(:);