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

1 visualizzazione (ultimi 30 giorni)
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?

Risposta accettata

Matt J
Matt J il 7 Apr 2015
Modificato: Matt J il 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)

Più risposte (0)

Categorie

Scopri di più su Elementary Math in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by