ndims
Number of dimensions of the input.
Syntax
Section titled “Syntax”n = ndims(A)Description
Section titled “Description”Returns the dimensionality of A. Scalars and vectors report 2 (MathJet treats them as 1×N or N×1 matrices, like MATLAB). Higher-dimensional arrays report their actual dimension count.
Examples
Section titled “Examples”ndims(7) % 2ndims([1 2 3]) % 2ndims(zeros(3,4,5)) % 3