Histcounts including values beyond bin edges

Hi - I feel this should be very simple but can't find the answer.
How do I use histcounts such that it includes values beyond the right- and left-most bin edges?
To be more clear, I want the first and last bins to include counts of values that are smaller than, and larger than, the extreme bin edges.
This doens't seem to be the default behaviour and I can't see how to change it.
Thank you

 채택된 답변

Bruno Luong
Bruno Luong 2020년 9월 17일
편집: Bruno Luong 2020년 9월 17일

1 개 추천

Append -Inf/+Inf in your finite edges

댓글 수: 2

Adam Danz
Adam Danz 2020년 9월 18일
If the min and max edge is the min and max of the data, then you probably want to replace the min & max edge with -/+inf rather than append the bin edge vector which would result in an empty bin-1 and the last bin would only represent the count for the max value of the data.
Thanks for the quick answer. I may have missed it but this should be in the documentation!

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

제품

릴리스

R2015b

태그

질문:

2020년 9월 17일

댓글:

2020년 9월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by