Matlab - hist plot with gaussian overlay
Hi, I'm having problems with this:
1. Use the random # generator, randn, and an initial state of 0 to create a vector of 1000 normally distributed random numbers.
a. Plot a histogram of these numbers with 30 bins, appropriately normalized such that the total area under the bars is 1. Set the axes to run from -4 to +4 on the x-axis and from 0 to 0.5 on the y-axis.
b. Overlay on top of this normalized histogram a plot of the continuous gaussian distribution.
c. Calculate the mean and standard deviation of this vector, and add these numbers to the title of the plot.
So far, I've only been able to do this:
Y = randn(size(1000));
and don't really know where to go from here.
Your help is greatly and forever appreciated!!!