For no particular reason I would like to know if it's possible to select the n number of biggest value in an array or matrix, all in a oneliner.
Say I have array:
A=randn(1,100);
And I want the biggest, e.g., 20 values, preferably ordered from high to low. So far I have the 2-liner:
A_ordered = sort(A,'descend');
A_big20 = A_ordered(1:20);
Does anyone know if this is possible in one line? If so, I would appreciate clues, ideas or an answer!