%% Bin Counts and Bin Edges
% Distribute 100 random values into bins. histcounts automatically chooses an appropriate bin width to reveal the underlying distribution of the data.

X = randn(100,1);
[N,edges] = histcounts(X)

% Copyright 2015 The MathWorks, Inc.