MATLAB: How to write a function that randomly sorts numbers into equal groups

randomrandom number generator

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.

Best Answer

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