How to count numbers greater than a determined value

6 Ansichten (letzte 30 Tage)
Fernando Dehonor
Fernando Dehonor am 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.

Akzeptierte Antwort

Matt J
Matt J am 20 Mai 2022
Bearbeitet: Matt J am 20 Mai 2022
out = cumsum( histcounts(heights,0.5:0.1:100-eps(100)) ,'reverse');

Weitere Antworten (0)

Kategorien

Mehr zu Get Started with MATLAB finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by