function [r]=exgausrnd(m,s,t,c,l)
% Generates ex-Gaussian random numbers
% by summing numbers sampled from an exponential and Gaussian PDFs
% All arguments are scalars. 
% m = mean of gaussian component
% s = S.D. of gaussian component
% t = mean of exponential component
% c = number of columns of resulting matrix
% l = number of lines of resulting matrix
% version 2.0 21/01/03
% (c) Yves Lacouture, UniversiteŽ Laval

if (t==0)           % Case of a normal variate
r=normrnd(m,s,c,l);
else
r=normrnd(m,s,c,l)+exprnd(t,c,l);
end
