% -*- texinfo -*- % @deftypefn {Function File} {} union (@var{a}, @var{b}) % @deftypefnx{Function File} {} union (@var{a}, @var{b}, 'rows') % Return the set of elements that are in either of the sets @var{a} and % @var{b}. For example, % % @example % @group % union ([1, 2, 4], [2, 3, 5]) % @result{} [1, 2, 3, 4, 5] % @end group % @end example % % If the optional third input argument is the string 'rows' each row of % the matrices @var{a} and @var{b} will be considered an element of sets. % For example, % @example % @group % union([1, 2; 2, 3], [1, 2; 3, 4], 'rows') % @result{} 1 2 % 2 3 % 3 4 % @end group % @end example % % @deftypefnx {Function File} {[@var{c}, @var{ia}, @var{ib}] =} union (@var{a}, @var{b}) % % Return index vectors @var{ia} and @var{ib} such that @code{a == c(ia)} and % @code{b == c(ib)}. % % @seealso{intersect, complement, unique} % @end deftypefn