ndgrid
Rectangular grid in N-D space
Syntax
[X1, X2, ..., Xn] = ndgrid(x1, x2, ... , xn)
[X1, X2, ..., Xn] = ndgrid(xg)
Input argument
x1, x2, … , xn - vector: grid vectors as separate arguments.
xg - vector: grid vector for all dimensions.
Output argument
X1, X2, … , Xn - array: full grid representation.
Description
[X1, X2, … , Xn] = ndgrid(x1, x2, … , xn) generates an n-dimensional full grid by replicating each grid vector.
[X1, X2, … , Xn] = ndgrid(xg) In this scenario, the single grid vector xg is used for all dimensions. The number of output arguments determines the dimensionality n of the resulting grid.
Examples
See also
History
Author
Allan CORNET
Last updated