This function returns a range with npts number of values. The initial starting value in the range is determined by seed.
The seed can be a value, a data range (e.g. a column), or strings (with "|" or "," or spaces as separators), or a string array. Note that a vector can substitute for the seed.
|Note: The seeding algorithm for Origin's methods of random number generation was changed for version 2016. For more information, see documentation for the system variable @ran.|
//When seed is a value dataset uniform(int npts[, int seed]) //When seed is strings dataset uniform(int npts, string seed) //When seed is a data range dataset uniform(int npts, dataset seed)
seed or vd
Returns a range with npts number of values.
This example shows use of a value as the seed:
col(A) = uniform(5);//Fill in the first 5 cells in column A with uniformly distributed data.
This example shows use of a data range(column) as seed:
col(B) = uniform(30, col(A));//Randomly choose 30 elements from col(A) to fill col(B)
This example shows use of a string array as seed:
//Create stringarray stra with strings "Origin" and "Lab" stringarray stra; stra.Add("Origin"); stra.Add("Lab"); //Use the stra as seed col(C) = uniform(10, stra);
This example shows how to use a string as seed (three kinds of separators are supported):
col(D) = uniform(10, "Origin|Lab"); col(E) = uniform(10, "Origin,Lab"); col(F) = uniform(10, "Origin Lab");