How to count numbers greater than a determined value

6 visualizaciones (últimos 30 días)
Fernando Dehonor
Fernando Dehonor el 20 de Mayo de 2022
Comentada: Fernando Dehonor el 21 de Mayo de 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.

Respuesta aceptada

Matt J
Matt J el 20 de Mayo de 2022
Editada: Matt J el 20 de Mayo de 2022
out = cumsum( histcounts(heights,0.5:0.1:100-eps(100)) ,'reverse');

Más respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by