How to count numbers greater than a determined value

6 vues (au cours des 30 derniers jours)
Fernando Dehonor
Fernando Dehonor le 20 Mai 2022
Need help structuring how I would tell MATLAB to count the number of values in a structure greater than a pre determined amount. For example:
I have a vector of data that holds heights ranging from 0 to 100 and I want to count how many are above a threshold above 0.5, then 0.6, then 0.7.... all the way to 100, which would be zero.

Réponse acceptée

Matt J
Matt J le 20 Mai 2022
Modifié(e) : Matt J le 20 Mai 2022
out = cumsum( histcounts(heights,0.5:0.1:100-eps(100)) ,'reverse');

Plus de réponses (0)

Catégories

En savoir plus sur Get Started with MATLAB dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by