The Math Forum



Search All of the Math Forum:

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


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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Generate random numbers with fixed sum and one value constraint
Replies: 7   Last Post: Nov 14, 2012 9:00 AM

Advanced Search

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

Posts: 3
Registered: 4/2/12
Re: Generate random numbers with fixed sum and one value constraint
Posted: Apr 2, 2012 6:05 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Actually I need that >0.6 value as first element, but thanks for your interest :)
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <a3741aa4-8fea-467a-9781-cd5e41dacad8@z5g2000yqj.googlegroups.com>...
> On Apr 2, 5:36 pm, "Dan " <scislowski.dan...@gmail.com> wrote:
> > Exactly what I need. Thank you.
> ------------------------------------------------------------
> Dan, if you want to make sure that the >0.6 value does not always
> occur at the first element, then add this code to Greg's code:
>
> randomIndices = randperm(length(x))
> x = x(randomIndices)
>
> That will locate the >0.6 number at a random location.




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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.