How to count numbers greater than a determined value

조회 수: 6 (최근 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 CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by