Code covered by the BSD License  

Highlights from
Union of several arrays

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

Union of several arrays

by Julia

 

24 Jul 2009

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

| Watch this File

File Information
Description

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
        

MATLAB release MATLAB 7.7 (R2008b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
matrix Julia 24 Jul 2009 11:44:37
union Julia 24 Jul 2009 12:44:45
common Julia 24 Jul 2009 12:44:45

Contact us at files@mathworks.com