How to sort matrix having multiple row and columns in ascending or descending order?
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
SANDEEP SINGH RANA
el 30 de Dic. de 2021
Comentada: SANDEEP SINGH RANA
el 30 de Dic. de 2021
Hi,
I have a matrix of 50 x 10. What i want to do is to take the mean of 50 x 10 (column wise) and get 1 x 10. Then arrange them in ascending order?
Now, order which i get after arranging 1 x 10 , i want to arrange or swap whole column ( i.e. 50 x 10) matrix like this order.
Thanks and Regards
0 comentarios
Respuesta aceptada
Walter Roberson
el 30 de Dic. de 2021
[~, idx] = sort(mean(YourMatrix));
newMatrix = YourMatrix(:,idx);
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!