Create categorical array
Use categorical to create a categorical
array from data with values from a finite set of discrete categories.
To group numeric data into categories, use discretize.
B = categorical( creates
a categorical array from the array, A)A. The categories
of B are the sorted unique values from A.
For more information on creating and using categorical arrays, see Categorical Arrays.
B = categorical( creates
one category for each value in A,valueset)valueset. The
categories of B are in the same order as the values
of valueset.
You can use valueset to include categories
for values not present in A. Conversely, if A contains
any values not present in valueset, the corresponding
elements of B are undefined.
B = categorical( creates
a categorical array with additional options specified by one or more A,___,Name,Value)Name,Value pair
arguments. You can include any of the input arguments in previous
syntaxes.
For example, you can specify that the categories have a mathematical ordering.