
Re: how can generate random integer numbers?
Posted:
Mar 19, 2013 6:02 PM


On 3/19/2013 5:22 PM, Steven_Lord wrote: > If the numbers need to be generated with replacement from the discrete > uniform distribution on integer values, use RANDI. If they need to be > generated without replacement from the discrete uniform distribution, > use RANDPERM. If they need to be generated with a nonuniform > distribution, things get more tricky.
For nonuniform generation (or uniform, for that matter) with or without replacement, you can use datasample if you have access to the Statistics Toolbox:
http://www.mathworks.com/help/stats/datasample.html

