LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a random generator with a max and a minimum

hello
can anybody telle me how to make a random generator for numbers with a maximum and minimum input

thanks in advance
0 Kudos
Message 1 of 8
(5,853 Views)
Use the random number vi.  Multiply by the range (maximum - minimum) and add the offset (minimum).
----
I am the founder of CnCSoftwareSolutions. When not cleaning up baby drool, I write about test data or work on Vision, a tool for understanding your test data. Visit me at www.cncsoftwaresolutions.com
0 Kudos
Message 2 of 8
(5,843 Views)
Message 3 of 8
(5,844 Views)
Also, the OpenG numeric library has a "Random Number - Within Range" VI.

0 Kudos
Message 4 of 8
(5,836 Views)
Thanks Jasonhill !
very fast reply

I'm a newbee at this so I have another question
I'm going to explain the situation :

I have to create a random number within limits for each month of the year
I want to put in the maximum and minimum in an array

How do I get the maximum and minimum for a particullar month in an array?

thanks in advance and sorry for my bad English
0 Kudos
Message 5 of 8
(5,828 Views)

Hi suske,

If you want a random day for a given month, this is how I would do it.

Hope this helps,

-D

Message Edited by Darren on 02-02-2006 01:35 PM

Message 6 of 8
(5,823 Views)
sorry, that was not what I ment  (thanks for the reply anyway)
lets work in steps

when I give in a number 1 -> 12  the month that stands for it will appear
now that month has a minimum and maximum limit I gave in before.
Those are the limits I want to use for my project..


thanks in advance
0 Kudos
Message 7 of 8
(5,810 Views)

Why not use a Ring that contains the names of each month?  That way there's no way somebody could enter an invalid value.

-D

0 Kudos
Message 8 of 8
(5,810 Views)