Phantom Documentation

[Help Home] [Phantom Home]
rand

int rand(int)

Return Type: int
Parameters: int Max

Description:
This function computes a pseudo-random number between 0 and Max, inclusive, and returns the number. Each subsequent call to 'rand' will produce a different pseudo-random number. The function uses the computers internal clock as a seed, so subsequent runs of a script with a call to 'rand' will produce different random number sets.

Example Code
1 >>disp(rand(15))
6
2 >>disp(rand(15))
13
3 >>disp(rand(15))
11
4 >>disp(rand(15))
15
5 >>disp(rand(15))
7


 


Copyright 2000-2011 Phantom Automated Solutions