Is it possible in matlab/octave to use the sort
function to sort an array based on the relative frequency of their elements?
For example the array
m= [4,4,4,10,10,10,4,4,5]
should result in this array:
[5,10,10,10,4,4,4,4,4]
5
is the less frequent element and is on the top while 4
is the most frequent and it's on bottom.
Should one use the indices provided by histcount
?