
Histogram

bella
i have one stupid question about randon number generator. how can i limit the intervalle of randon number which i would like to generate? for exemple in Excel if i want to generate a number between [30, 50] i write in one cell "= 30+rand()*(50-30)" how can i do it with "gnoise function for exemple"?
thanks in advend
Bella
I think you want enoise which has a uniform (flat) probability distribution.
To achieve the equivalent of your Excel code try:
I suggest you read the help associated with these functions. Type this into your command line:
Hope this helps,
Kurt
December 19, 2013 at 03:02 am - Permalink
but i would like to know the meaning of 10 and 40 in your exemple, is it that we make a random number between 10 and 40 [10,40] or what? please can we choose my exemple or another exemple that show how to generate a random number limited by a minimum and a maximum.
i have read the noise functions but i think it is not mentioned in the noise functions how to generate a random number between one maximum and one minimum.
bella2013
December 19, 2013 at 04:25 am - Permalink
December 19, 2013 at 06:30 am - Permalink
I think you want
( ( ( enoise ( range ) + range ) / 2 ) + MinOfRange )
In your example this becomes
( ( ( enoise ( 20 ) + 20 ) / 2 ) + 30)
enoise will return [-20, 20]
so you get ( ( [-20, 20] + 20 ) / 2 ) + 30
reducing...
( [0, 40 ] / 2 ) + 30
[0, 20] + 30
[30, 50]
enoise includes the endpoints.
December 19, 2013 at 06:34 am - Permalink
i can start yet with my histogram.
thanks everybody.
Bella
December 20, 2013 at 02:27 am - Permalink