Histcounts including values beyond bin edges

6 ビュー (過去 30 日間)
David McVea
David McVea 2020 年 9 月 17 日
コメント済み: David McVea 2020 年 9 月 18 日
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 日
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.
David McVea
David McVea 2020 年 9 月 18 日
Thanks for the quick answer. I may have missed it but this should be in the documentation!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

製品


リリース

R2015b

Community Treasure Hunt

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

Start Hunting!

Translated by