I'm new to MATLAB, and I have a set of data that I need to plot on a histogram. Furthermore, based on the estimated standard deviation and mean of my sample, I need to overlay a Gaussian with these parameters onto the figure. Finally, I would like to plot vertical lines that indicate the mean and +/- 1 standard deviation. What is the best way to do so? I have tried using the histfit function, but then on the figure when trying to add the vertical bars for the standard deviation (Tools->Data Statistics), the "std" value is not the same as that calculated by std(data) (I would like to know why). Does anybody know of a way to do all of this?
Thanks!