If you have a rather big array and only want a few elements out of it. This would be my solution.
Arraycopy = Array;
for j = 1:n
[a, Index(j)] = max(Arraycopy);
Arraycopy(Index(j)) = -inf;
end
maximumValues = Array(Index);
I think it should be faster and less RAM demanding than the sort solution.