Products & Services Industries Academia Support User Community Company

Learn more about Statistics Toolbox   

union - Class: categorical

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

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS