function p = poisson(N,lambda) %p = poisson(N,lambda) if length(N)==1, p = exp(-lambda)*lambda^N / prod(1:N); else, %% If the input is a vector, give back the Poisson evaluated %% in as many samples. N = 1:length(N); p = exp(-lambda)*lambda.^[0 N] ./ cumprod([1 N]); end;