I have bucket bounds from -98% to +100% and the no of observations are 41 from Excel.I want calculate how many of these observations occur from my data: =COUNTIFS(my data,"<"&$C56,my data,">="&$C55)/COUNT(my data). How do I do this in MatLab?

답변 (1개)

Guillaume
Guillaume 2018년 2월 2일

0 개 추천

If there's only one bucket you're interested in then,
sum(mydata >= lowerlimit & mydata < upperlimit) / numel(mydata)
If you're interested in more than one bucket then you can do it all at once for all the buckets with:
histcounts(mydata, yourbucketedges, 'Normalization', 'probability')

댓글 수: 1

Siphiwo Nqangase
Siphiwo Nqangase 2018년 2월 5일
Thanks for your answer, I used "histcounts" and it worked.

댓글을 달려면 로그인하십시오.

카테고리

질문:

2018년 2월 2일

댓글:

2018년 2월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by