categorical

Methods

Method Reference: categorical.gt

categorical: TF = gt (A, B)

Greater than for ordinal categorical arrays.

TF = gt (A, B) is the equivalent of the syntax TF = A > B and returns a logical array of the same size as the largest input with its elements set to true where the corresponding elements of A are greater than B and set to false where they are not. A and B must be size compatible, which translates to they can be the same size, one can be scalar, or for every dimension, their dimension sizes must be equal or one of them must be 1.

If categorical arrays A and B are both ordinal, they must have the same set and ordering of categories. Unordered categorical arrays cannot be compared for greater than inequality.

One of the input arguments can also be a character vector, a cellstr scalar or a string scalar as long as the other is a categorical array. In this case, a logical array of the same size as the categorical array is returned in which every element is tested for greater than inequality by comparing its category with that specified by the string argument.

Undefined elements always return false, since they are not comparable to any other categorical values including other undefined elements.

Source Code: categorical