Sets
****

Octave has a limited set of functions for managing sets of data, where a set is defined as a collection unique elements.

 -- Function File: create_set (X)
     Return a row vector containing the unique values in X, sorted in ascending order.  For example,

          create_set ([ 1, 2; 3, 4; 4, 2 ])
          => [ 1, 2, 3, 4 ]

union, intersection, and complement

 -- Function File: union (X, Y)
     Return the set of elements that are in either of the sets X and Y.  For example,

          union ([ 1, 2, 4 ], [ 2, 3, 5 ])
          => [ 1, 2, 3, 4, 5 ]

create_set, intersection, and complement

 -- Function File: intersection (X, Y)
     Return the set of elements that are in both sets X and Y. For example,

          intersection ([ 1, 2, 3 ], [ 2, 3, 5 ])
          => [ 2, 3 ]

create_set, union, and complement

 -- Function File: complement (X, Y)
     Return the elements of set Y that are not in set X.  For example,

          complement ([ 1, 2, 3 ], [ 2, 3, 5 ])
          => 5

create_set, union, and intersection