samer@15: function X=randnat(M) samer@15: % randnat - Draw random natural number from uniform distribution samer@11: % samer@11: % randnat :: samer@11: % M:natural ~'maximum value', samer@11: % -> [[D]->[M]] ~'size D array of numbers in 1..M'. samer@11: % samer@11: % The size is specified as in the RAND function, except that if samer@11: % only one dimension is given, we create a vector, not a square samer@11: % matrix, eg samer@11: samer@15: X=1+floor(M*rand); samer@11: