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

1 Ansicht (letzte 30 Tage)
Joey
Joey am 7 Apr. 2015
Bearbeitet: Matt J am 7 Apr. 2015
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?

Akzeptierte Antwort

Matt J
Matt J am 7 Apr. 2015
Bearbeitet: Matt J am 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)

Weitere Antworten (0)

Kategorien

Mehr zu Elementary Math finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by