Flip a Coin or Roll a Dice with Matlab
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
Platform Compatibility
Windows macOS LinuxTags
Acknowledgements
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!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.