Rank matrix elements in descending order

2 vues (au cours des 30 derniers jours)
Fred John
Fred John le 27 Jan 2015
Modifié(e) : Image Analyst le 27 Jan 2015
Hi!
I have a matrix from which I want the elements to be moved to a table where the elements are sorted via descending order. Can I do this using the av_output command? Or something else?
Thanks!

Réponse acceptée

Image Analyst
Image Analyst le 27 Jan 2015
Modifié(e) : Image Analyst le 27 Jan 2015
Why not just use the sort() function?
m=magic(5);
% Sort columns in descending order.
sorted_m = sort(m, 'descend')

Plus de réponses (0)

Catégories

En savoir plus sur Shifting and Sorting Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by