pointsFromGridVectors

Convert rectilinear grid vectors into an explicit point matrix.


Declaration

 [pointMatrix,gridSize] = pointsFromGridVectors(gridVectors)

Parameters

  • gridVectors cell array of grid vectors

Returns

  • pointMatrix matrix with one row per grid point
  • gridSize number 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

\[\mathrm{pointMatrix} = [X_1(:)\ \cdots\ X_d(:)].\]
  [points, gridSize] = TensorSpline.pointsFromGridVectors({x,y});
  B = TensorSpline.matrixForPointMatrix(points, knotPoints=tKnot, S=[3 3]);