MATLAB: How to sort the max values from a matrix

sort

Hello everyone !
In the following 577X2 matrix I have tickers of stocks in the first column and the number of occurence in the second one.
How would I keep the 80 first stocks (tickers) that occurred the most ?
Many thanks in advance !
Pierre

Best Answer

[~, order] = sort(Occurences.Momentum(:, 2), 'descend');
top80 = Occurences.Momentum(order(1:80), :)
Or:
sortedData = sortrows(Occurences.Momentum, 2, 'descend');
top80 = sortedData(1:80, :)