HyperMath

rand

rand

Previous topic Next topic No expanding text in this topic  

rand

Previous topic Next topic JavaScript is required for expanding text JavaScript is required for the print function  

Generates random data from the uniform probability distribution.

Syntax

M = rand()

M = rand(m)

M = rand([m, n])

M = rand(m, n)

Arguments

Name

Description

 

m

Number of output rows.

 

n

Number of output columns.

Outputs

Name

Description

 

M

A matrix of double; random numbers from the continuous uniform distribution.

Example

Syntax

 

print(rand())

print(rand([3 2]))

print(rand(3, 2))

Comments

The 'rand' function is a random matrix generator.  rand() without arguments gives a matrix of size 1x1.

The size inputs m and n should be positive integers.

See Also:

randn

T_CDF

T_InvCDF

T_PDF

Probability Distributions