MATLAB: Gaussian Distribution

distributiongaussian

Hi All, I am trying to plot a amplitude Gaussian distribution in Matlab. I have only amplitude peak, mean and sigma (sd) values. The peak is corresponding to the mean. How to get a Gaussian normal plot using only that three values? What could be the code for that?

Best Answer

This is really just plotting an equation, for practical purpose, you can plot from -4*sd to 4*sd. Let's say mu is the mean,
x = linspace(-4*sd,4*sd,1000);
y = 1/(2*pi*sd)*exp(-(x-mu).^2/(2*sd^2));
plot(x,y);