MATLAB: Plotting multiple histograms in one figure

histogramplotting

Hi,
I have some data points, simulated as follows:
for t=1:10000
H1(t)=normrnd(0,0.05);
H2(t)=normrnd(0,0.10);
H3(t)=normrnd(0,0.30)
end
So essentially I generated three different random variables. I would like to do something very obvious.
I want to plot the histogram of each variable in the SAME graph/figure with the respective curve fitting to visualize the difference in the variances for these three random variables.
How I can implement this in Matlab?
Thanks

Best Answer

Another's shown the basics of adding to a plot; I'll note there's no need for loops and generating variables like H1, H2, H3 is generally bad practice in Matalab...use the vector facilities of Matlab, it is, after all, called "MATrix LABoratory" for a reason...
nSamp=10000;
mu=0;
sg=[0.05 0.1 0.3];
H=normrnd(mu,repmat(sg,nSamp,1));
hist(H,100), xlim([-1.3 1.3])