File Exchange

image thumbnail

Union of several arrays

version 1.0 (1.14 KB) by

Uses matlab union function recursively to create the union of several arrays

5 Downloads

Updated

View License

function [varargout] = union_several (varargin)
% function [varargout] = union_several (varargin)
% varargout{1} is the union vector
% varargout{i>1} are the indices of the various varargin (in their order)

numarr = length(varargin);
union_arr = varargin{1};
for i=1:numarr
        union_arr= union(union_arr,varargin{i});
end
varargout{1} = union_arr;
for i=1:numarr
        [union_arr, temp,varargout{i+1}]= union(union_arr,varargin{i});
end
        

Comments and Ratings (0)

MATLAB Release
MATLAB 7.7 (R2008b)
Tags Add Tags

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video