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 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
Get step-by-step solutions from verified subject matter experts
