Generates a random series based on a uniform or flat distribution. The optional range arguments let you determine the output range.
GRANDOM(length, spacing, rangelow, rangehigh)
|
length |
- |
An integer. The length of the output series. |
|
spacing |
- |
A real, the spacing (delta
x) between each point of the |
|
rangelow |
- |
Optional. A real, the low end of the range. Defaults to 0.0 |
|
rangehigh |
- |
Optional. A real, the high end of the range. Defaults to 1.0 |
A series.
grandom(100,0.1,1,10)
generates a uniformly distributed random series of 100 points, spaced every 0.1 x-units, with values ranging from 1 to 10.
W1: grandom(50000,1)
W2: hist(W1, 30)
The histogram in W2 indicates that the random sequence in W1 is uniformly distributed.
If no range is given, default is [0,1]. If only one range is given, range is [0,range] or [range,0], depending on whether range is positive or negative.
See SEEDRAND to set a new seed value for the pseudo-random sequence.
GRANDOM can be abbreviated GRAND.