Clear Filters
Clear Filters

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

2 views (last 30 days)
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

Matt J
Matt J on 7 Apr 2015
Edited: Matt J on 7 Apr 2015
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 Elementary Math in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!