categorical

Methods

Method Reference: categorical.cellstr

categorical: cstr = cellstr (C)

Convert categorical array to a cell array of character vectors.

cstr = cellstr (C) returns a cellstr array of character vectors, cstr, which has the same size as the input categorical C.

Source Code: categorical

Example: 1

cellstr converts the array back into a cell array of character vectors — the labels themselves. <undefined> elements become empty strings.

 C = categorical ({'M'; 'S'; ''; 'L'})
C =
  4x1 categorical array

    M              
    S              
    <undefined>    
    L
 cellstr (C)
ans =
  4x1 cell array

    {'M'          }    
    {'S'          }    
    {'<undefined>'}    
    {'L'          }