Just to clarify, are you saying that you have a categorical array, you are trying to apply the unique command to that array, and you are getting an error that says the array isn't scalar?
Please post the full error message you are getting.
Is the array too big to put in a MAT file and upload here?
If C is your array, and suppose it has N elements (where N is large), and the line
gives the error you mention. Then you could try unique on, say, the first million rows (or whatever):
and see if that fails. If so, then keep narrowing down:
and so on. When it does not give the error, then zoom in on the other part of the array:
etc, to narrow down to a section of the array that is small enough to visually inspect more easily.