MATLAB: Taking min of a vector and all values within 10% error

all valueserrorminvector

I need a way to get all the values within a 10% error of the minimum value of a vector. How could I go about that?

Best Answer

This considers both positive and negative min(x),
xmin=min(x);
coeff=1+0.1*sign(xmin);
values = x(x<=coeff*xmin)