Rectangular grid in N-D space

`[`

replicates the grid vectors `X1,X2,...,Xn`

]
= ndgrid(`x1,x2,...,xn`

)`x1,x2,...,xn`

to produce an
`n`

-dimensional full grid.

`[`

specifies a single grid vector `X1,X2,...,Xn`

]
= ndgrid(`xg`

)`xg`

to use for all dimensions. The
number of output arguments you specify determines the dimensionality
`n`

of the output.

The

`ndgrid`

function is similar to`meshgrid`

. However,`ndgrid`

supports 1-D to N-D while`meshgrid`

is restricted to 2-D and 3-D.