function y=exprnd(mu,m,n)
% Simple random generator following an Exponential function based on
% Devroye, L. (1986). Non-Uniform Random Variate Generation. 
% New York:Springer-Verlag.
% arguments are scalars
% mu : mean of the Exp. function
% m, n : size of the generated matrix
% version 1.0 10/10/99
% (c) Yves Lacouture, UniversitŽ Laval

if nargin==1             %case of a scalar
	y = -mu.*log(rand);
else
	y = -mu.*log(rand(m,n));
end
