ndims

ndims(X) returns the number of dimensions in X.

Examples

> ndims(1)

	[ans:2]
> ndims(rand(2,3))

	[ans:2]
> ndims(rand(2,3,4))

	[ans:3]
> ndims(rand(2,3,4,2))

	[ans:4]

Resources

See also

length | size