How to count numbers greater than a determined value

2 ビュー (過去 30 日間)
Fernando Dehonor
Fernando Dehonor 2022 年 5 月 20 日
コメント済み: Fernando Dehonor 2022 年 5 月 21 日
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.

採用された回答

Matt J
Matt J 2022 年 5 月 20 日
編集済み: Matt J 2022 年 5 月 20 日
out = cumsum( histcounts(heights,0.5:0.1:100-eps(100)) ,'reverse');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by