How to sort a matrix in a random order
20 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Gentrit Mehmeti
el 11 de Nov. de 2019
Comentada: Gentrit Mehmeti
el 11 de Nov. de 2019
How to sort a matrix in random order?
0 comentarios
Respuesta aceptada
James Tursa
el 11 de Nov. de 2019
E.g.,
>> x = reshape(1:24,4,6)
x =
1 5 9 13 17 21
2 6 10 14 18 22
3 7 11 15 19 23
4 8 12 16 20 24
>> x(:) = x(randperm(numel(x)))
x =
7 12 3 19 16 23
20 24 10 11 1 17
21 14 8 5 13 18
6 22 15 4 2 9
Más respuestas (0)
Ver también
Categorías
Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!