N = ndims(A) returns
the number of dimensions in the array A. The number
of dimensions is always greater than or equal to 2.
The function ignores trailing singleton dimensions, for which size(A,dim)
Input array, specified as a scalar, vector, matrix, or multidimensional
array. This includes numeric arrays, logical arrays, character arrays,
categorical arrays, tables, structure arrays, cell arrays, and object