Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
Joey
Joey le 7 Avr 2015
Modifié(e) : Matt J le 7 Avr 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?

Réponse acceptée

Matt J
Matt J le 7 Avr 2015
Modifié(e) : Matt J le 7 Avr 2015
This considers both positive and negative min(x),
xmin=min(x);
coeff=1+0.1*sign(xmin);
values = x(x<=coeff*xmin)

Plus de réponses (0)

Catégories

En savoir plus sur NaNs dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by