how to randomize the column position of a matrix?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
suppose A=[D G H K ... O];
i want to do C=[H D O .... G.. K]
i also want to keep the information about the order of randomization to use it other matrix further manipulation.
0 comentarios
Respuesta aceptada
Dishant Arora
el 9 de Sept. de 2012
ind=randperm(size(A,2));
C=zeros(size(A));
C=A(:,ind);
ind preserves the order of randomization.
2 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!