names = categories(A)
names = categories(A, 'OutputType', type)
| Parameter | Description |
|---|---|
| A | Input categorical array. |
| type | Output representation: 'char', 'string', or 'categorical'. |
| Parameter | Description |
|---|---|
| names | Category names in category order. |
categories returns the category list attached to a categorical array. Undefined elements are not categories.
The default output is a cell array of character vectors.
A = categorical({'red','blue','red'}); names = categories(A)
A = categorical({'small','large'}); names = categories(A, 'OutputType', 'string')
| Version | Description |
|---|---|
| 2.0.0 | initial version |