Navigation

Operators and Keywords

Function List:

C++ API

: [y1, y2, …, yn] = ndgrid (x1, x2, …, xn)
: [y1, y2, …, yn] = ndgrid (x)

Given n vectors x1, …, xn, ndgrid returns n arrays of dimension n.

The elements of the i-th output argument contains the elements of the vector xi repeated over all dimensions different from the i-th dimension. Calling ndgrid with only one input argument x is equivalent to calling ndgrid with all n input arguments equal to x:

[y1, y2, …, yn] = ndgrid (x, …, x)

Programming Note: ndgrid is very similar to the function meshgrid except that the first two dimensions are transposed in comparison to meshgrid. Some core functions expect meshgrid input and others expect ndgrid input. Check the documentation for the function in question to determine the proper input format.

See also: meshgrid.

Package: octave