Download Sysquake User Manual

Transcript
390
Sysquake User Manual ©1999-2012, Calerga Sàrl
ndgrid
Arrays of N-dimension coordinates.
Syntax
(X1, ..., Xn) = ndgrid(x1, ..., xn)
(X1, ..., Xn) = ndgrid(x)
Description
ndgrid(x1,...,xn) produces n arrays of n dimensions. Array i is
obtained by reshaping input argument i as a vector along dimension
i and replicating it along all other dimensions to match the length of
other input vectors. All output arguments have the same size.
With one input argument, ndgrid reuses it to match the number of
output arguments.
(Y,X)=ndgrid(y,x) is equivalent to (X,Y)=meshgrid(x,y).
Example
(X1, X2) = ndgrid(1:3)
X1 =
1
1
1
2
2
2
3
3
3
X2 =
1
2
3
1
2
3
1
2
3
See also
meshgrid, repmat
ndims
Number of dimensions of an array.
Syntax
n = ndims(A)
Description
ndims(A) returns the number of dimensions of array A, which is at
least 2. Scalars, row and column vectors, and matrices have 2 dimensions.