MATLAB: Find the max values within a matrix, in the range of the highest value and 10% lower.

MATLAB

Hello,
I have a matrix with a random set of numbers, I can find a list of the highest numbers using the code below. However how do I modify this to return the values within the range of the highest value and 10% below the highest value?
HC = find(zz == max(zz(:)));
Thanks in advance.

Best Answer

%demo data
a=randi([40 50],1,20)
%result
a=a(a>=0.9*max(a))
Related Question