time | Calls | line |
---|
| | 427 | function stream = getGlobalStream
|
| | 428 | %RANDSTREAM.GETGLOBALSTREAM Get the current global random number stream.
|
| | 429 | % STREAM = RandStream.GETGLOBALSTREAM returns the current global random
|
| | 430 | % number stream, i.e., the stream that the RAND, RANDI, and RANDN functions
|
| | 431 | % draw values from.
|
| | 432 | %
|
| | 433 | % RAND, RANDI, and RANDN all rely on the same stream of uniform pseudorandom
|
| | 434 | % numbers, known as the global random number stream. RAND draws one value
|
| | 435 | % from that stream to generate each uniform value it returns; RANDI draws
|
| | 436 | % one uniform value from that stream to generate each integer value it
|
| | 437 | % return; and RANDN draws one or more uniform values to generate each normal
|
| | 438 | % value it returns. Note that there are also RAND, RANDI, and RANDN methods
|
| | 439 | % for which you specify a specific random stream from which to draw values.
|
| | 440 | %
|
| | 441 | % The RNG function is a shorter alternative for many uses of
|
| | 442 | % RANDSTREAM.getGlobalStream.
|
| | 443 | %
|
| | 444 | % See also RNG, RANDSTREAM, RANDSTREAM.SETGLOBALSTREAM,
|
| | 445 | % RANDFUN/RAND, RANDFUN/RANDN, RANDFUN/RANDI.
|
0.006 | 1 | 446 | stream = localGetSetGlobalStream();
|
< 0.001 | 1 | 447 | end
|
Other subfunctions in this file are not included in this listing.