Change histogram to more bars
    7 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
Categories
				Find more on Histograms in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

