Randomized Groups of Array

4 次查看(过去 30 天)
Zoe Brown
Zoe Brown 2020-10-20
回答: Matt J 2020-10-20
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
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)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by