function r = dirrand(m,n)
% DIRRAND - Uniform dirichlet random vectors

%   Author: Aki Vehtari <Aki.Vehtari@hut.fi>

if nargin < 2
  n=1;
end

r=rand(m,n);
r=-reallog(r);
rs=sum(r);
for i1=1:m
  r(i1,:)=r(i1,:)./rs;
end
