Randomized Groups of Array

If I have an array of doubles, how would I place those numbers into randomized groups? Ex. I have 250 numbers and I want them in 50 groups of 5 or 25 groups of 10, but all randomized.

回答 (1 件)

Matt J
Matt J 2020 年 10 月 20 日

0 投票

Ex. I have 250 numbers and I want them in 50 groups of 5
reshape( randperm(250) , 5,50)
or 25 groups of 10,
reshape( randperm(250) , 10,25)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

タグ

質問済み:

2020 年 10 月 20 日

回答済み:

2020 年 10 月 20 日

Community Treasure Hunt

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

Start Hunting!

Translated by