% plotTwoGaussians.m
% Plots 1/sqrt(2*pi*a^2)*exp(-x^2/2/a^2) 
% for a=1 and a=2 in the same figure
% Jose M Soler, Sep.2011

xmin=-10; xmax=10; dx=0.01;
x=xmin:dx:xmax;                            % x values
a=1; y1=1/sqrt(2*pi*a^2)*exp(-x.^2/2/a^2); % first Gaussian
a=2; y2=1/sqrt(2*pi*a^2)*exp(-x.^2/2/a^2); % second Gaussian

plot(x,y1,x,y2)
set(gca,'FontSize',20)
xlabel('x')
ylabel('1/sqrt(2 \pi a^2) exp(-x^2/2a^2)')
legend('a=1','a=2')
title('Two Gaussians')
