MATLAB: FETCH LARGEST NUMBERS comparelargest numbers I HAVE A SET OF 10 NUMBERS . AND I WANT THE OUT PUT TO BE THE LARGEST THREE NUMBERS FROM THE ABOVE SET……. THANKS IN ADVANCE Best Answer 1. Take the capslock off.2. Sort your array in descending order. Use the SORT function.3. Take the first 3 numbers in the sorted array. Related SolutionsMATLAB: Retrun largest numbers >> [~, idx] = sort(A);>> B = A(sort(idx(end-2:end)))) MATLAB: How to find the Nth high number in a matrix A As Iain suggested, sort is a great way to go, but as you mention that you have a matrix, you might want to sort every element of the matrix:sorted = sort(values(:));sorted(end-4) Related QuestionLargest Candidate RuleFetch from bloomberg!Sortrows
Best Answer