ArrayTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Low-level Manipulation : Matrices, Vectors, and Arrays : ArrayTools : ArrayTools/RandomArray

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

1..2 x 1..3 x 1..4 x 1..5 x 1..6 ArrayData Type: float8Storage: rectangularOrder: Fortran_order

(4)

RandomArraydistribution=normal

0.707235932058173

(5)

RandomArray3,distribution=normal

0.6857876680961562.248302741331050.5642482247002150.6685152334727181.505157364996820.7499767897454421.127365596208771.303353704004980.788332041459299

(6)

RandomArray1,2,distribution=normal

0.3998167122951640.100128522592894

(7)

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

1..2 x 1..1 x 1..3 x 1..6 x 1..4 ArrayData Type: float8Storage: rectangularOrder: Fortran_order

(8)

See Also

ArrayTools[Size]

rtable_indexing

Statistics[Sample]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam