Change histogram to more bars
13 views (last 30 days)
Show older comments
I am generating random numbers. The histogram has a sample size of 20 but only 5 bars. How can I control the bar numbers?

0 Comments
Accepted Answer
Sindar
on 25 Oct 2020
histogram accepts the number of bins as a second argument:
x = randn(1000,1);
nbins = 25;
h = histogram(x,nbins)
More Answers (1)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!