Question: Matlab probelm Write a function called event that simulates the scenerio below. The function should have no inputs and a single output that must be

 Matlab probelm Write a function called event that simulates the scenerio

Matlab probelm

Write a function called event that simulates the scenerio below. The function should have no inputs and a single output that must be either 0 or 1 A given bag of candy has 30 pieces of candy. Each piece of candy has an equal probablity of being any one of four different flavors. Simulate a bag of candy and have your function return a 1 if there are 3 or fewer pieces of a given flavor. If there are 4 or more pieces of all four flavors, return a 0. Your Function C Reset MATLAB Documentation 1 function out-event Code to call your function C Reset 1This script calculates the approximate probability 2 cnt 8 3 for j-1:100 cnt-cnt+event: 5 end 6 100 (cnt/1000)

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!