To roll 4 dices at the same time
Show older comments
i want to create a program in matlab about rolling 4 dices (fair dices, 6 sided) at the same time, and then assign them the probabilities. then i have to conduct n trials of the experiment and plot it also please help me, please write a ful matlab code am v poor in matlab
2 Comments
Jan
on 18 Sep 2011
Writing full MATLAB code is not usual in this forum. If your MATLAB skills are too low to complete the program, do this in another programming language you are more familiar with.
Muhammad Abdullah
on 18 Sep 2011
Accepted Answer
More Answers (1)
Image Analyst
on 18 Sep 2011
Do you need me to spell out the needed adaptations?
numberOfDice = 4;
because you wanted 4 dice, not 6, and
distribution(diceValues(die)) = distribution(diceValues(die)) + 1;
to store your results for this roll, and
bar(distribution);
to do the plotting of the distribution. Now you have everything. Certainly it can't be that tough to figure out now! I think you really need to at least scan through the "Getting started" section because the code I posted was very simple, basic, and self explanatory and should have been easily understood by anyone who has done any programming at all.
1 Comment
Muhammad Abdullah
on 19 Sep 2011
Categories
Find more on Noncentral t Distribution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!