Flip a Coin or Roll a Dice with Matlab

version 1.0.2 (3.21 KB) by Hristo Zhivomirov
Flipping (tossing) coins or rolling (flipping) dice for simulation or game purposes.


Updated 30 Apr 2020

View License

The present submission contains two Matlab functions that provide generation of outcomes from one of the two processes: Flipping (tossing) of one or more coin(s) or rolling (flipping) of one or more N-sided dice. The functions could be used for simulation or game purposes (e.g., Monte Carlo simulation or Backgammon game).

Two examples are given to clarify the usage of the functions. For convenience, the input and output arguments are given in the beginning of each function.

Cite As

Hristo Zhivomirov (2022). Flip a Coin or Roll a Dice with Matlab (https://www.mathworks.com/matlabcentral/fileexchange/75288-flip-a-coin-or-roll-a-dice-with-matlab), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2017b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Matrix Visualization with Matlab

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!