Programmer Guide/Command Reference/EVAL/rand: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
Generation of linear distributed pseudo random numbers in the interval <code>-1 <= ''r'' < 1</code>.
Generation of linear distributed pseudo random numbers in the interval <code>-1 &le; ''r'' < 1</code>.
----
----
;Usage 1: '''rand'''
;Usage 1: <code>rand</code>
;Result 1: Returns a pseudo random number.
;Result 1: Returns a pseudo random number.
----
----
;Usage 2: '''<code>rand(''seed'' {, ''nr'' {, ''nc''}})</code>'''
;Usage 2: <code>rand(''seed'' {, ''nr'' {, ''nc''}})</code>
:;''seed'': if this value is not equal ''0'', it is used to initialize the random number generator
:;''seed'': if this value is not equal ''0'', it is used to initialize the random number generator
:;''nr'': number of rows of the result (default=1)
:;''nr'': number of rows of the result (default=1)
:;''nc'': number of columns of the result (default=1)
:;''nc'': number of columns of the result (default=1)
;Result 2: A numeric object ''r'' with ''nr'' rows and ''nc'' columns. Each element of ''r'' is set to a linear distributed pseudo random numbers in the interval <code>-1 <= ''r'' < 1</code>.
;Result 2: A numeric object ''r'' with ''nr'' rows and ''nc'' columns. Each element of ''r'' is set to a linear distributed pseudo random numbers in the interval <code>-1 &le; ''r'' < 1</code>.
;See also: [[../grand|grand]], [[../sample|sample]], [[../shuffle|shuffle]], [[../fill|fill]], [[../init|init]]


;See also: [[Programmer_Guide/Command_Reference/EVAL/grand|grand]], [[Programmer_Guide/Command_Reference/EVAL/sample|sample]], [[Programmer_Guide/Command_Reference/EVAL/shuffle|shuffle]]
[[../#Functions|<function list>]]
 
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]

Latest revision as of 19:08, 21 April 2011

Generation of linear distributed pseudo random numbers in the interval -1 ≤ r < 1.


Usage 1
rand
Result 1
Returns a pseudo random number.

Usage 2
rand(seed {, nr {, nc}})
seed
if this value is not equal 0, it is used to initialize the random number generator
nr
number of rows of the result (default=1)
nc
number of columns of the result (default=1)
Result 2
A numeric object r with nr rows and nc columns. Each element of r is set to a linear distributed pseudo random numbers in the interval -1 ≤ r < 1.
See also
grand, sample, shuffle, fill, init

<function list>

Navigation menu

Personal tools