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

Online Help

All Products    Maple    MapleSim


RandomTools Flavor: variable

describe a flavor of a random variable

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

variable

variable(alphabet, length=integer)

Parameters

alphabet

-

(optional) {string,symbol} restricts the characters that form the name

length = integer

-

(optional) number of characters in the generated name

Description

• 

The flavor variable describes a random symbol.  By default variables are single-character lowercase letters from the English alphabet.

  

The length and alphabet options match those defined by the StringTools:-Random command.

• 

Generated random variables are globally scoped in the Maple environment.  This command does not attempt to avoid returning a variable that matches something in use, possibly with an assigned value.

Examples

withRandomTools:

Generatevariable

y

(1)

Generatevariableabc

c

(2)

Generatevariableupper,length=3

GKY

(3)

Compatibility

• 

The RandomTools Flavor: variable command was introduced in Maple 2018.

• 

For more information on Maple 2018 changes, see Updates in Maple 2018.

See Also

flavor/structured

rand

RandomTools

RandomTools[Generate]

StringTools[Random]

type/name