Learn R Programming

matlab (version 1.0.2)

ndims: MATLAB ndims function

Description

Provides number of array dimensions.

Usage

ndims(A)

Arguments

A
object of which to determine the number of dimensions

Value

Returns the number of dimensions in the array A.

Details

Simply invokes length(size(A)).

See Also

size

Examples

Run this code
ndims(2:9)			# 2
ndims(magic(4))			# 2
ndims(array(1:8, c(2,2,2)))	# 3

Run the code above in your browser using DataLab