Documentation Center

  • Trial Software
  • Product Updates

ndims

Class: categorical

Number of dimensions of categorical array

The nominal and ordinal array data types might be removed in a future release. To represent ordered and unordered discrete, nonnumeric data, use the MATLAB® categorical data type instead.

Syntax

n = ndims(A)

Description

n = ndims(A) returns the number of dimensions in the categorical array A. The number of dimensions in an array is always greater than or equal to 2. Trailing singleton dimensions are ignored. Put simply, ndims(A) is length(size(A)).

See Also

Was this topic helpful?