MATLAB: Find maximum among the elements in the matrix lower than 80% of max element of entire matrix

find maximumif allif statementMATLABmatrixmatrix arraymatrix manipulationmaximum

Hi!
I have a matrix A(n,n). I determine the maximum element like S=max(A(:)).
Now, I would like to find the maximum element only among the elements of the matrix A which are lower than 0.8*S.
Could you suggest some solutions of that problem?
Thank you in advacne!

Best Answer

%Try this:
Result = A(A<(0.8*S))