Question: MATLAB scripts Consider the following script: clear; d= roll_2_dice (10000,100); [freq, prop] = tabulate_2_dice(d) ; disp (freq); disp (prop); This generates the following variables: Where
MATLAB scripts![MATLAB scripts Consider the following script: clear; d= roll_2_dice (10000,100); [freq, prop]](https://s3.amazonaws.com/si.experts.images/answers/2024/08/66cef9cbbf2a0_39566cef9cb49568.jpg)
Consider the following script: clear; d= roll_2_dice (10000,100); [freq, prop] = tabulate_2_dice(d) ; disp (freq); disp (prop); This generates the following variables: Where - d is the simulated dice rolls in a row vector. - freq is a 112 array that contains the frequency of each combination. For example, freq(1) should always be zero, as the minimum combination of rolls is 2 [1+1). You would expect freq(7) to be the highest ( 1/6 of all outcomes). - prop is a 112 array that contains the proportions of each outcome. For example, the outcome of the number seven is shown below. freq(7) ans =1655 prop(7) ans =0.1655 Your task is to implement the functions roll_2_dice and tabulate_2_dice. These are summarised below
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
