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 to generate random number vector that satisfies the following equation
Replies: 1   Last Post: Apr 19, 2013 2:31 AM

Advanced Search

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

Posts: 1,440
Registered: 11/8/10
Re: How to generate random number vector that satisfies the following equation
Posted: Apr 19, 2013 2:31 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"venki Kavuri" <venki_5s@yahoo.com> wrote in message <kkpp5u$qj5$1@newscl01ah.mathworks.com>...
> How to generate random number vector that satisfies the following equation
>
> 0.005<= Current Vector + rand() <= 0.03.
>
> Note: random numbers can be positive or negative as along as they satisfy the equation.
>
> Thanks in advance
>
> Venki


Generate a vector r of random numbers uniformly distributed in [0,1] using rand.
Then a vector v with the property of rand() from above above can be obtained by
v=0.005+r*0.025-Current Vector.

Best wishes
Torsten.



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.