plotting the histogram of data points
古いコメントを表示
please consider this sample code:
figure
data = [0,2,9,2,5,8,7,3,1,9,4,3,5,8,10,0,1,2,9,5,10];
hist(data)
Why this histogram plots the data points 0 & 1 with frequency 4 (on Y-axis),when in fact 0 & 1 appear two times in data.

採用された回答
その他の回答 (1 件)
Walter Roberson
2013 年 11 月 11 日
1 投票
You have 11 different values (0 through 10) but only 10 bins (default number to use if you do not specify the number in a hist() call).
カテゴリ
ヘルプ センター および File Exchange で Histograms についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!