MATLAB Function Reference Previous page   Next Page
ndims

Number of array dimensions

Syntax

Description

n = ndims(A) returns the number of dimensions in the array A. The number of dimensions in an array is always greater than or equal to 2. Trailing singleton dimensions are ignored. A singleton dimension is any dimension for which size(A,dim) = 1.

Algorithm

ndims(x) is length(size(x)).

See Also

size


Previous page  ndgrid ne Next page

© 1994-2005 The MathWorks, Inc.