rand

From DavinciWiki
Jump to: navigation, search


64-bit SafeYes

Description

Generates random numbers

Arguments and Return Values

Arguments: Dimensions of the desired array and seed parameters

Return Value: A numeric array containing random integers

Usage

Syntax: random([x=INT], [y=INT], [z=INT], [seed=INT])

The rand() function generates random integers. It is an alias for the command random using type=rand.

The value seed can be specified to seed any of the random number generators, to produce reproducable random numbers. Any dimension not specified defaults to a value of 1.


Examples

dv> rand(3,3,3)
3x3x3 array of float, bsq format [108 bytes]
1.41350e+09     1.39465e+09     4.49710e+08
8.09232e+08     1.84135e+09     1.96417e+09
3.89436e+08     4.77787e+08     3.03656e+07

1.88523e+09     5.04331e+08     1.18540e+09
1.24739e+09     6.79460e+08     2.12548e+09
1.76450e+09     1.53378e+07     1.30523e+09

3.01582e+08     4.43266e+08     8.30154e+08
1.78611e+09     6.63188e+07     2.03595e+09
7.47978e+08     1.98393e+08     1.64967e+09

DavinciWiki Mini-Nav Bar

Contents


Contact Developers

  • davinci-dev [AT] mars.asu.edu

All other topics

  • See navigation on the left

Related Functions

Recent Core Changes

Modified On: 07-06-2009

Personal tools