categorical

Methods

Method Reference: categorical.char

categorical: CM = char (C)

Convert categorical array to a 2-D character matrix.

CM = char (C) returns a character matrix CM, which contains numel (C) rows and each row contains the category name for the corresponding element of C(:).

Source Code: categorical

Example: 1

char converts the array to a character matrix of its labels, one row per element (shorter labels are padded with spaces, as for any char matrix).

 C = categorical ({'small'; 'large'; 'small'})
C =
  3x1 categorical array

    small    
    large    
    small
 char (C)
ans =

small
large
small