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

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?

 Accepted Answer

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

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Asked:

on 7 Apr 2015

Edited:

on 7 Apr 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!