Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: how can generate random integer numbers?
Replies: 8   Last Post: Mar 19, 2013 6:02 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Peter Perkins

Posts: 114
Registered: 8/12/11
Re: how can generate random integer numbers?
Posted: Mar 19, 2013 6:02 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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 non-uniform 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




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.