Change histogram to more bars
17 ビュー (過去 30 日間)
古いコメントを表示
I am generating random numbers. The histogram has a sample size of 20 but only 5 bars. How can I control the bar numbers?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/392048/image.png)
0 件のコメント
採用された回答
Sindar
2020 年 10 月 25 日
histogram accepts the number of bins as a second argument:
x = randn(1000,1);
nbins = 25;
h = histogram(x,nbins)
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Histograms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!