DataLab is a compact statistics package aiming at exploratory data analysis. Please visit the DataLab Web site for more information....


Declaration: RandomFillMatrix(var Mat: TDouble2DArray; Mode: integer; Mean, Range: double): integer;);
Fills the two-dimensional dynamic array Mat with random numbers whose properties are controlled by the parameters Mode, Mean and Range. The Mode parameter controls whether uniformly distributed random numbers are generated (Mode = 0) or normally distributed random numbers (Mode = 1).

Depending on the type of distribution the other parameters have different meanings:

Distribution Uniform (Mode=0) Normal (Mode=1)
Mean median of the distribution mean of the distribution
Range range of the distribution standard deviation

Example: The statement RandomFillMatrix (MyMat,0,100,20); fills the matrix MyMat with uniformly distributed random numbers in the range between 90 and 110 (= Median +/- Range/2