MATLAB: Is there a way to generate pseudo-random integers directly in MATLAB 7.6 (R2008a)

MATLAB

I would like to generate a series of pseudo-random integers, but all the random-number generation algorithms in MATLAB either generate floating-point numbers, or threshold floating-point numbers to create integers. Is there a way to create these integers directly?

Best Answer

This enhancement has been incorporated in Release 2008b (R2008b). For previous product releases, read below for any possible workarounds:
For MATLAB 7.6 (R2008a) or earlier, if you have the Extended Symbolic Math Toolbox you can generate uniformly distributed pseudorandom integers using the MAPLE command in MATLAB. The following example illustrates how to generate a pseudorandom integer between 1 and 10:
myRandomInteger = maple('myProcedure:=rand(1 .. 10): myProcedure()')