union multiple arrays (more than two)

51 views (last 30 days)
I want to union more than two arrays. Thank you

Accepted Answer

Matt J
Matt J on 31 Oct 2021
Edited: Matt J on 31 Oct 2021
The obvious way it so use a loop,
U=arrays{1}; %cell array containing arrays
for i=2:N
U=union(U,array{i});
end
Are you asking if there is a way that doesn't use a loop? No, I don't believe there is.

More Answers (0)

Categories

Find more on Multidimensional Arrays in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!