Set union for categorical arrays
Syntax
C = union(A,B)
[C,IA,IB] = union(A,B)
Description
C = union(A,B) when A and B are
categorical arrays returns a categorical vector C containing
the combined values from A and B but
with no repetitions. 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,IA,IB] = union(A,B) also returns index
vectors IA and IB such that C is
a sorted combination of the elements A(IA) and B(IB).
See Also
intersect, ismember, setdiff, setxor, unique
 | unifstat | | unique (categorical) |  |
Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
Get the Interactive Kit