function Gaussian

% _____ ETH Zürich :  Gauss   ____
clear all; close all; clf

fprintf(1, '\n')   
disp(['°°°°°°°°°°°°° S T A R T °°°°°°°°°°°° ' ,date, ' °°°°°°°°°°°°°°'])

x = -4: 0.1:4;

subplot(121)
   plot(x,y);
   hold on
   plot([-1 -1], [0 gauss(-1, 0, 1)], '--');
   plot([ 1  1], [0 gauss(1, 0, 1)], '--');
   xlabel('\bf XXX')
   ylabel('\bf YYY')
   text(-0.85, 0.13 ,'68.3 %');
   title('\bf Gauss von ETH Zürich')
   grid
   axis square;
% :::::::::::::::::
subplot(122)
   xn = x(x < 0);
   xp = x(x >=0);
   Fn = 0.5 - erf(abs(xn)/sqrt(2))/2;
   Fp = 0.5 - erf(xp/sqrt(2))/2;
   plot(x, [Fn Fp], '-')
   hold on
   Fn1 = 0.5 - erf(abs(1)/sqrt(2))/2;
   Fp1 = 1 - Fn1;
   plot([-1 -1], [0 Fn1], '--')
   plot([ 1  1], [0 Fp1], '--')
   plot([-4 -1], [Fn1 Fn1], '--')
   plot([-4  1], [Fp1 Fp1], '--')
   xlabel('\bf XXX')
   ylabel('\bf YYY')
   grid
   axis square;

% ::::::::::::::::::::::::::::::::::::::::::
function y = gauss(x,xm,sig)
   x = (x-xm)/sig
   y = exp(-0.5*x.^2) / (sig*sqrt(2*pi));
end