Documentation Center

  • Trial Software
  • Product Updates


Class: categorical

Length 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.


n = length(A)


n = length(A) returns the size of the longest dimension of the categorical array A when A is not empty. If A is a vector, this is the same as its length. length is equivalent to max(size(x)) for nonempty arrays, and 0 for empty arrays.

See Also

| |

Was this topic helpful?