Question: Write a function to simulate the roll of a die. Your function requires no arguments and must return a number 1 -6 that simulates the

 Write a function to simulate the roll of a die. Your

Write a function to simulate the roll of a die. Your function requires no arguments and must return a number 1 -6 that simulates the outcome of rolling a fair die. Use the MATLAB rand function (rand returns a number between 0 and 1; successive calls to rand are independent) to assign the die value (or you may use one of the other MATLAB random number functions such as randi). Make sure your function is well commented and includes a "help" block to aid the user (give a textual description of what the function does as well as a description of how to use the function) Hint (one way to do it): assign '1' to the die if O s rand number

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!