MATLAB: How to find indices of values that are fraction of the maximum value

maxvector

Hello,
I am trying to find the indices of those values in the vector that are within the certain fraction of the maximum value of the matrix. For example, if my vector is x, then I can find the maximum value m and its location index I\ind using the following command:
[m, ind] = max(x);
Now, I want to find the location of all those values that are greater than a certain fraction, say 95%, of the maximum value m. Is there a way to do this?
Any help would be greatly appreciated.
Regards, Anindya

Best Answer

ind=find(x>=.95*max(x));
Related Question