Mercurial > hg > octave-lyh
view scripts/set/union.m @ 974:a0fa18fa9d0c
[project @ 1994-12-12 20:21:35 by jwe]
author | jwe |
---|---|
date | Mon, 12 Dec 1994 20:21:35 +0000 |
parents | 3470f1e25a79 |
children | 5cffc4b8de57 |
line wrap: on
line source
function y = union(a,b) # usage: union(a,b) # # Returns the union of sets a and b. # # See - create_set, intersection, complement if (nargin != 2) usage ("union(a,b)"); endif if(isempty(a)) y = create_set(b); elseif(isempty(b)) y = create_set(a); else [nra, nca] = size(a); a = reshape(a,1,nra*nca); [nrb, ncb] = size(b); b = reshape(b,1,nrb*ncb); y = create_set([a, b]); endif endfunction