MATLAB: How to find the nine biggest numbers

nine biggest numbers

I have a n*n matrix and I want to find nine biggest numbers in it. How can I do it in MATLAB?

Best Answer

A = rand(9);
m = sort(A(:),'descend');
m(1:9)