Matlab Pract Problem
Matlab Pract Problem
. Write a Matlab code that will allow a user to enter in a critical number between 0 and 1, and then track the number of times that a random number must be generated in order to be greater than the critical number . Output the number of attempts that were necessary, and the numbers that were not successful. Be sure that you code is working correctly. (Hint: the command rand will be useful here)
Problem 2. This problem is similar to Problem #1 but with some extra complications. Write a Matlab code that will allow a user to enter in a critical number between 0 and 1, and then a tolerance that will provide a window. Then track how many tries it takes until the random number falls within the window. For example, if the user selects 0.5 as the critical number and 0.01 as the tolerance, how many times does it take for a random number to be generated that is between 0.49 and 0.51. Again, store the numbers that did not work.