If I create a categorical array that requires merging categories (as shown below – notice categories with values 2 and 3 both have the same label 'b'), the resulting categorical array cannot be sorted without error.
>>z = categorical([1 2 3 2 3 1]', [1 2 3]', {'a','b','b'}')
>>sort(z)
Error using categorical/sort (line 48)
First argument of CATEGORICALSORT must be a full, real array of type uint8, uint16 or uint32.
Best Answer