How can I write a function that randomly sorts numbers into equal groups?

1 view (last 30 days)
I want to write a function that randomly sorts numbers 1-72 into 6 equal groups of 12 (with no repeats).
Any help would be great,
Thanks.

Accepted Answer

dpb
dpb on 24 Nov 2017
N=72; G=6; % constants per problem definition
rnv=reshape(randperm(N),[],G); % separated into G columns

More Answers (0)

Categories

Find more on Random Number Generation 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!