%
disp(' ');
disp(' Rayleigh_integrate.m  ver 1.0  December 4, 2012 ');
disp(' Tom Irvine ');
disp('  ');
disp(' This script calculates the probabilty under the ');
disp(' Rayleigh distribution curve for a given sigma value. ');
%
while(1)
   disp(' ');
   lambda=input(' Enter the sigma level (example 3 for 3-sigma): ');
%
   P=exp(-0.5*lambda^2);
%
   out1=sprintf('\nP(%6.3g-sigma < A < infinity) = %7.3g ',lambda,P);
   disp(out1);
   out2=sprintf('                               = %7.3g ',100*P);
   out2=strcat(out2,'%'); 
   disp(out2);
%
   disp(' ');
   disp(' Another case?  1=yes 2=no ')
   ic=input(' ');
   if(ic==2)
       break;
   end
%
end