ndgrid
[X1, X2, ..., Xn] = ndgrid (x1, x2, ..., xn) [X1, ..., Xk] = ndgrid (x) N-dimensional coordinate arrays. Xj has size numel(x1)-by-...-by- numel(xn) and Xj(i1,...,in) = xj(ij). A single input with at most one output gives the column x(:); a single input with k >= 2 outputs is used for all k dimensions. Output classes follow the inputs.