function F = Rayleigh_cdf(X,muX)
% F = Rayleigh_cdf(X,muX)
% return CDF of Rayleigh distribution  with mean muX at points X
 
%    Reference: http://en.wikipedia.org/wiki/Rayleigh_distribution

  idx = find(X<=0);
  X(idx) = 0.01;

  modeX = muX * sqrt(2/pi);

  F = 1.0 - exp(-0.5*(X/modeX).^2); 

% ------------------------------------------------------------ Rayleigh_cdf
