pointsFromGridVectors
Convert rectilinear grid vectors into an explicit point matrix.
Declaration
[pointMatrix,gridSize] = pointsFromGridVectors(gridVectors)
Parameters
gridVectorscell array of grid vectors
Returns
pointMatrixmatrix with one row per grid pointgridSizenumber of points along each dimension
Discussion
Use this helper to convert rectilinear grid vectors into the point-matrix format accepted by TensorSpline.matrixForPointMatrix.
If [X1,...,Xd] = ndgrid(gridVectors{:}), then the returned matrix is
[points, gridSize] = TensorSpline.pointsFromGridVectors({x,y});
B = TensorSpline.matrixForPointMatrix(points, knotPoints=tKnot, S=[3 3]);