%% Specify Number of Histogram Bins
% Plot a histogram of 1,000 random numbers sorted into 25 equally spaced bins.

x = randn(1000,1);
nbins = 25;
h = histogram(x,nbins)

%
% Find the bin counts.

counts = h.Values

% Copyright 2015 The MathWorks, Inc.