I am working on a code to measure the probability of dice rolls landing on a specific value. For example, if one rolls 3 different dice the probability of the sum of the values being somewhere between 6-12 is much greater than all three dice landing on 1 resulting in a sum of three. At only 10 experiments, there is much error and there is basically a 1 in 10 chance it could land on any number from 3-18. With a much greater number of experiments, the histogram will show a greater value for the sums that were much more common. Here is my problem; I would like to be able to run a for loop that could create four different histograms that would increase in the number of rolls per histogram. For example, the first histogram would include 10 rolls, the next 100, the following 1000, and the last 10000.
What I would like to do is basically say:
h=histogram(SumRoll, Bins, 'Normalization','probability');
ylabel('Percent Probability (%=1/100)')
xlabel('Dice Sum Value')
title(['Dice Probability for ' num2str(i) ' Rolls of 3 Dice'])
In my head, the way this works out is it starts with 10 rolls, then runs the code again but now with 10*10 rolls, which would be 100, then the following would be 100*10 which would be 1000, finally stopping on 10000 runs. I notice two problems when doing this. The first is it does not save every version of the histogram, the second is the final run of the histogram does not equal 10000 runs, but rather just under it.
How could I alter this code to not only keep each iteration of histograms, but also ensure each histogram stays on the value intended?
MATLAB Version: 188.8.131.523579 (R2017b)