 function  y=fitfun(a,x);
 % function for fitting normal distribution

 y=1/(sqrt(2*pi)*a(2))*exp(-(x-a(1)).^2./(2*a(2).^2));

 return
