Documentation Center

  • Trial Software
  • Product Updates


Class: categorical

Convert categorical array to character 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.


B = char(A)


B = char(A) converts the categorical array A to a 2-D character matrix. char does not preserve the shape of A. B contains numel(A) rows, and each row of B contains the categorical level label for the corresponding element of A(:).

See Also


Was this topic helpful?