function p = erlangk(x,h,k)
%ERLANGK Calculates probabilities using the Erlang-k formula
%Call p = erlangk(x,h,k)
%Where x = values at which the density is to be calculated
%      h = average service time (=1/mu}
%      k = number of processes in cascade to make up the erlang k process=
%      p = values of calculated density
%
u=1/h;
p=u^k * x.^(k-1) .* exp(-u*x)/prod(1:(k-1));