function F = Poisson_cdf(n,L)
% F = Poisson_cdf(n,L)
% return Prob[ N <= n events during time interval t ] with return period T 
% where L = t/T
%
%    Reference: http://en.wikipedia.org/wiki/Poisson_distribution

  n = round(n); 

  nN = length(n); 
  F = NaN(1,nN); 

  for in = 1:nN  

    ni = [ 0 : n(in) ]; 
    F(in) =  L.^ni * ( 1./factorial(ni') ) * exp(-L); 

  end

% idx = find(K<0);
% K(idx) = 0;
%
%  Kf = floor(K+1);
%
%  F = 1.0 - gamma(Kf) .* gammainc(1./T,Kf) ./ factorial (Kf);

% ----------------------------------------------------------------- Poisson_cdf
