Randomized Groups of Array

3 visualizaciones (últimos 30 días)
Zoe Brown
Zoe Brown el 20 de Oct. de 2020
Respondida: Matt J el 20 de Oct. de 2020
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.

Respuestas (1)

Matt J
Matt J el 20 de Oct. de 2020
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)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by