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

    %% Histogram of Multiple Columns  

% Copyright 2015 The MathWorks, Inc.


%% 
% Generate three columns of 1,000 random numbers and plot the three column
% overlaid histogram.

x = randn(1000,3); 
hist(x)    

%%
% The values in |x| are sorted among 10 equally spaced bins between the
% minimum and maximum values. |hist| sorts and bins the columns of |x|
% separately and plots each column with a different color.