random (replaces TRandom)
The random function returns a 1-dimensional array containing random numbers distributed according to a uniform probability density function. The related random1 function returns a single uniformly distributed random number.
tbl = random( nCount )
tbl = random( nCount, nMin, nMax )
nCount is the number of random numbers.
nMin, nMax are the lower and upper limiting values in the array. if omitted, random numbers are created in the range [0, ..., 1 ].
tbl is a 1-dimensional array containing nCount values.
On failure, nil is returned.
The following script creates 1 million random numbers, creates a histogram of the values, and plots their histogram.
|
-- create 1 million random deviates |
|
-- create a Histogram object |
|
-- compute the histogram |
|
-- plot the histogram |
|
|
Mira Pro x64 Script User's Guide, v.8.73 Copyright Ⓒ 2024
Mirametrics, Inc. All Rights Reserved.