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

Online Help

All Products    Maple    MapleSim


RandomTools

  

Generate

  

generate a particular random object

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Generate(expr)

Parameters

expr

-

expression; defines the form of the random object

Description

• 

The Generate(expr) function generates a particular random object that is determined by expr. The expr parameter is used to:

  

* indicate a particular Maple type,

  

* indicate a flavor template, where specific keywords describe the form of the returned random object, or

  

* choose a random entry from a Maple data structure.

  

The following list describes the Maple types, flavor templates, and data structures that are recognized by Generate. For more information about how to generate a random number that corresponds to one of these items, see the corresponding help page (RandomTools/flavor/<topic>).

choose

complex

distribution

exprseq

float

identical

integer

list

listlist

Matrix

negative

negint

nonnegative

nonnegint

nonposint

nonpositive

nonzero

nonzeroint

polynom

posint

positive

rational

set

string

structured

truefalse

variable

Vector

• 

The Generate function calls the Maple rand procedure.

• 

The Generate function maps onto all objects that are not of type atomic.

• 

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

Examples

withRandomTools&colon;

Generateinteger

−104281139460

(1)

Generatelistfloat&comma;3

0.2342493224&comma;0.1799302829&comma;0.5137385362

(2)

Generatenegint&comma;integer&comma;float

−65655460113&comma;−113591692544&comma;0.2907448089

(3)

Matrix3&comma;3&comma;Generaterationaldenominator=10&comma;makeproc=true

1109102545121502515

(4)

Matrix3&comma;3&comma;Generaterationaldenominator=10&comma;makeproc=true

110310359102531025310310

(5)

Vector4&comma;Generatecomplexintegerrange=1..100&comma;makeproc=true

67+78I51+53I12+19I63+40I

(6)

See Also

LinearAlgebra[RandomMatrix]

LinearAlgebra[RandomVector]

makeproc

rand

RandomTools

randpoly

type/atomic