RandomArray - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


ArrayTools

  

RandomArray

  

randomly generate scalars, Matrices, and Arrays of values drawn from a uniform or normal distribution

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

RandomArray()

RandomArray(distribution = uniform)

RandomArray(n)

RandomArray(n, distribution = uniform)

RandomArray(m, n)

RandomArray(m, n, distribution = uniform)

RandomArray(m, n, o, ...)

RandomArray(m, n, o, ..., distribution = uniform)

RandomArray(distribution = normal)

RandomArray(n, distribution = normal)

RandomArray(m, n, distribution = normal)

RandomArray(m, n, o, ..., distribution = normal)

Parameters

m, n, o, ...

-

length of each dimension

distribution = uniform, distribution = normal

-

type of a statistic distribution

Description

• 

The RandomArray() and RandomArray(distribution = uniform) functions randomly generate a scalar value drawn from a uniform distribution on the unit interval.

• 

The RandomArray(n) and RandomArray(n, distribution = uniform) functions randomly generate an n-by-n matrix of values derived as described above.

• 

The RandomArray(m, n) and RandomArray(m, n, distribution = uniform) functions randomly generate an m-by-n matrix of the same.

• 

The RandomArray(m, n, o, ...) and RandomArray(m, n, o, ..., distribution = uniform) functions randomly generate an m-by-n-by-o-by-... array of the same.

• 

The RandomArray(distribution = normal) function randomly generates a scalar value drawn from a standard normal distribution.

• 

The RandomArray(n, distribution = normal) function randomly generates an n-by-n matrix of values derived as described above.

• 

The RandomArray(m, n, distribution = normal) function randomly generates an m-by-n matrix of the same.

• 

The RandomArray(m, n, o, ..., distribution = normal) function randomly generates an m-by-n-by-o-by-... array of the same.

• 

A negative entry for the length of a dimension is treated as zero.

• 

This function is part of the ArrayTools package, so it can be used in the short form RandomArray(..) only after executing the command with(ArrayTools). However, it can always be accessed through the long form of the command by using ArrayTools[RandomArray](..).

Examples

withArrayTools:

RandomArray

0.2342493224

(1)

RandomArray2

0.2784982188670480.6323592462254100.09754040499940950.913375856139019

(2)

RandomArray3,2

0.9571669482429460.9648885351992770.9705927817606160.9575068354342980.1576130816775480.546881519204984

(3)

RandomArray2,3,4,5,6

RandomArraydistribution=normal

−0.707235932058173

(4)

RandomArray3,distribution=normal

−0.685787668096156−2.248302741331050.5642482247002150.668515233472718−1.505157364996820.7499767897454421.127365596208771.303353704004980.788332041459299

(5)

RandomArray1,2,distribution=normal

−0.3998167122951640.100128522592894

(6)

RandomArray2,1,3,6,4,distribution=normal

See Also

ArrayTools[Size]

rtable_indexing

Statistics[Sample]