View License

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

» Watch video

Highlights from
Union of several arrays

Be the first to rate this file! 6 Downloads (last 30 days) File Size: 1.14 KB File ID: #24834 Version: 1.0

Union of several arrays


Julia (view profile)


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

| Watch this File

File Information

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});
varargout{1} = union_arr;
for i=1:numarr
        [union_arr, temp,varargout{i+1}]= union(union_arr,varargin{i});

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.

Contact us