Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
How to generate random number vector that satisfies the following equation

Subject: How to generate random number vector that satisfies the following equation

From: venki Kavuri

Date: 18 Apr, 2013 21:39:10

Message: 1 of 2

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

Subject: How to generate random number vector that satisfies the following equation

From: Torsten

Date: 19 Apr, 2013 06:31:16

Message: 2 of 2

"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.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us