Rectangular grid in ND space
[X1,X2,X3,...,Xn] = ndgrid(x1gv,x2gv,x3gv,...,xngv)
[X1,X2,...,Xn] = ndgrid(xgv)
[X1,X2,X3,...,Xn] = ndgrid(x1gv,x2gv,x3gv,...,xngv)
replicates
the grid vectors x1gv
,x2gv
,x3gv,...,xngv
to
produce a full grid. This grid is represented by the output coordinate
arrays X1
,X2
,X3,...,Xn
.
The ith dimension of any output array Xi
contains
copies of the grid vector xigv
.
[X1,X2,...,Xn] = ndgrid(xgv)
is
the same as [X1,X2,...,Xn] = ndgrid(xgv,xgv,...,xgv)
. In other words, you can reuse the same grid vector
in each respective dimension. The dimensionality of the output arrays
is determined by the number of output arguments.
The coordinate arrays [X1,X2,X3,...,Xn]
are
typically used to evaluate functions of several variables and to create
surface and volumetric plots.

Grid vector specifying a series of grid point coordinates in the ith dimension. 

Generic grid vector specifying a series of point coordinates. 

The 
griddedInterpolant
 mesh
 meshgrid
 surf