How to rank data in a whole matrix
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, I need to rank the data in a matrix but tiderank function does it for each column separately. how can I do it for all data in all rows and columns together? in a way that first cell of first column is first rank and last cell of last column is last rank.
Thank you
0 commentaires
Réponse acceptée
the cyclist
le 19 Déc 2012
If A is your matrix, then
>> reshape(sort(A(:)),size(A))
should do it. You can use the 'descend' argument to the sort function if you wanted largest to smallest.
0 commentaires
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!