Union of several arrays

Version 1.0.0.0 (1,14 KB) von Julia
Uses matlab union function recursively to create the union of several arrays
820 Downloads
Aktualisiert 24. Jul 2009

Lizenz anzeigen

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

Zitieren als

Julia (2024). Union of several arrays (https://www.mathworks.com/matlabcentral/fileexchange/24834-union-of-several-arrays), MATLAB Central File Exchange. Abgerufen .

Kompatibilität der MATLAB-Version
Erstellt mit R2008b
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0.0.0