MATLAB: How to create two bell shape curves gaussian with the areas under these curves equal to 1, the same mean but different standard deviations. Thanks! Best Answer Do you have the Statistics Toolbox? x = -10:0.01:10; y = normpdf(x,0,1); y1 = normpdf(x,0,sqrt(2));If you do not have the Statistics Toolbox, you can just use the definition of the Gaussian f = @(x) 1/sqrt(2*pi)*exp(-x.^2/2); integral(f,-10,10) g = @(x) 1/sqrt(2*pi*2)*exp(-x.^2/4); integral(g,-10,10)To see the curves for above: fcurv = 1/sqrt(2*pi)*exp(-x.^2/2); gcurv = 1/sqrt(2*pi*2)*exp(-x.^2/4); plot(x,fcurv); hold on; plot(x,gcurv,'r') Related SolutionsMATLAB: Plotting standard normal rvs If you have the Statistics Toolbox, then this is extremely easy, just using the normpdf function which encodes the formula for you.MU = 10;SIGMA = 1;x = 5 : 0.01 : 15;y = normpdf(x,MU,SIGMA)figureplot(x,y)If you don't have the toolbox, then just usey =1./sqrt(2*pi*SIGMA) * exp(-(x-MU).^2 /(2 * SIGMA));instead. MATLAB: How to plot distribution curve of multiple data x = [-3:.1:3];y = normpdf(x,0,1);y2 = normpdf(x,0,0.5);plot(x,y,x,y2)More info:https://es.mathworks.com/help/stats/normal-distribution.html Related QuestionLognormal fitting with 10-baseHow to obtain the mean and standard deviation of a gaussian PDFHelp with coding (integral)Normalizing a normal distributionPDF function does not give same result as normpdf
Best Answer