lambda_s = 2;
n = 0:100;
t = 5; %ms
[p] = poisson(lambda_s,n,t)
numMedioArrivals = sum(n.*p)


numMedio = sum(N.*p)

plot(n,p), xlabel('n'), ylabel('P(N=n) = p(n)')
grid on

%

function [p] = poisson(lambda,n,t)
p = (((lambda*t).^n)./factorial(n)).*exp(-lambda.*t);
end