This program will simulate roulette whilst placing bets in accordance with the Martingale strategy. For those unfamiliar, the player bets on one of reds/blacks or odds/even. After a loss, the bet size is doubled. After a win, the bet size is returned to the unit stake and a guaranteed profit is made.
This program was written from scratch and may contain errors after a few months of not using MATLAB. It generates a random number which will then be used to calculate winnings for that spin. Overall money left is then calculated along with the bet size next spin. This can be looped many times and the money left at the end of each loop is displayed. You have the option of 3 graphs to display: the distribution of numbers, the money left after each spin, and the money left after each loop.
Gary Greet (2020). Martingale Roulette Simulator (https://www.mathworks.com/matlabcentral/fileexchange/47468-martingale-roulette-simulator), MATLAB Central File Exchange. Retrieved .