Version:

Generates uniformly distributed pseudorandom integers in the range you specify. randint uses the same pseudorandom number generator as rand.

## Syntax

e = randint(a)
e = randint(a, b)
e = randint(a, b, range)
e = randint(a, b, c)
e = randint(a, b, range, s)
e = randint(a, b, c, s)

## a

Number of rows in e. a is a positive integer.

## b

Number of columns in e. b is a positive integer.

## range

Range of pseudorandom integers to generate. range is an integer. If range is positive, MathScript generates pseudorandom integers in the interval [0, range-1]. If range is 0, MathScript generates integers of 0. If range is negative, MathScript generates pseudorandom integers in the interval [range+1, 0]. The default range is 2, and MathScript generates pseudorandom integers in the interval [0, 1].

## c

Lower and upper bound of the interval of pseudo-random integers to generate, which are separated by a comma or white spaces and enclosed in square brackets. c is an array with two integer values.

## s

Seed of the pseudorandom number generator used for the next call of the function.

## e

a-by-b matrix of uniformly distributed pseudorandom integers in the interval you specify. If you do not specify b, e returns a square matrix of length a.