function y = poisson(ns, rate) % y = poisson(ns, rate); % simulation of poisson process % make random array with no zeros while 1 y = rand(1, fix(ns)); if all(find(y)) break; end; end y = -log(y) / rate;