Fortune Telling Collection - Free divination - Matlab uses rand and integer functions to simulate the numbers on each side of the dice.

Matlab uses rand and integer functions to simulate the numbers on each side of the dice.

First, the number on the dice is from 1 to 6. The random number generated by rand is greater than 0 and less than 1, so it can be constructed as follows

1+(6-1) * rand (1) and then round. Here, it is suggested round rounding the whole number, which should be a random number generated by rand.

A = round (1+5 * rand (1)) will satisfy uniform distribution.