Documentation Center

  • Trial Software
  • Product Updates

length

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.

Syntax

n = length(A)

Description

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?