Mercurial > hg > trimatlab
diff private/randnat.m @ 15:a6d5597bd922
Trying alternative fixed point computation in mc_global_info1>mc_fixpt2;
Also factored out randnat from some other functions.
author | samer |
---|---|
date | Mon, 27 Feb 2012 14:41:24 +0000 |
parents | 0e0f2805ef9c |
children |
line wrap: on
line diff
--- a/private/randnat.m Sun Feb 26 23:17:29 2012 +0000 +++ b/private/randnat.m Mon Feb 27 14:41:24 2012 +0000 @@ -1,18 +1,13 @@ -function X=randnat(M,varargin) -% randnat - Draw Random natural numbers from uniform distribution +function X=randnat(M) +% randnat - Draw random natural number from uniform distribution % % randnat :: % M:natural ~'maximum value', -% D:[[1,E]] ~'size of E-dimensional array' % -> [[D]->[M]] ~'size D array of numbers in 1..M'. % % The size is specified as in the RAND function, except that if % only one dimension is given, we create a vector, not a square % matrix, eg -% -% randnat(10,3) :: [[3,3]->[10]]. -% randnat(20,2,5,7) :: [[2,5,7]->[20]]. -% randnat(20,5) :: [[5,1]->[20]]. -X=1+floor(M*rand(tosize(varargin{:}))); +X=1+floor(M*rand);