www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/DecreaseNumberOfHistogramBinsExample.m

    %% Decrease Number of Histogram Bins
% Plot a histogram of 1,000 random numbers and return a handle to the
% histogram object.

% Copyright 2015 The MathWorks, Inc.

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

%%
% Use |fewerbins| to decrease the number of bins in the histogram.
fewerbins(h);
fewerbins(h)