% Generates a neg. exponential random variate
% define mean of distribution
% beta = mean of distribution
% f(t) = 1/beta * exp(-t / beta)

n = 1000;				% No. of points used in the generation process
beta = 20;				% mean of the distribution
u=rand(1,n);		 	% random number generator (0-1)
x = - beta * log(u);	% Neg. exponential random variate

hist(x)
grid

xlabel('Random Variable')
ylabel('Observations')
