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

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.

 채택된 답변

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

질문:

2017년 11월 24일

댓글:

2017년 11월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by