Home > freetb4matlab > set > union.m

union

PURPOSE ^

% Return the set of elements that are in either of the sets @var{a} and

SYNOPSIS ^

function [y, ia, ib] = union (a, b, varargin)

DESCRIPTION ^

% -*- 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

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Sat 16-May-2009 00:04:49 by m2html © 2003