view private/randnat.m @ 18:062d46712995 tip

Moved mc_global_info1 back to public folder
author samer
date Mon, 02 Apr 2012 21:50:43 +0100
parents a6d5597bd922
children
line wrap: on
line source
function X=randnat(M)
% randnat - Draw random natural number from uniform distribution
%
% randnat :: 
%    M:natural   ~'maximum value', 
% -> [[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

X=1+floor(M*rand);