Set difference for categorical arrays
Syntax
C = setdiff(A,B)
[C,I] = setdiff(A,B)
Description
C = setdiff(A,B) when A and B are
categorical arrays returns a categorical vector C containing
the values in A that are not in B.
The result C is sorted. The set of categorical
levels for C is the sorted union of the sets of
levels of the inputs, as determined by their labels.
[C,I] = setdiff(A,B) also returns index
vectors I such that C = A(I).
See Also
intersect, ismember, setxor, union, unique
 | SetDefaultYfit (CompactTreeBagger) | | setlabels (categorical) |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit