Filter löschen
Filter löschen

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

3 Ansichten (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)

Community Treasure Hunt

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

Start Hunting!

Translated by