Description
Before you run the simulation in MATLAB, answer the following questions:
• How many people do you think will be left if you ran this experiment an infinite number of times? Call this the Steady State solution.
• How many days do you think it will take to get to the steady state solution?
Create MATLAB code to simulate the number of guests remaining each day until you get to the steady state solution.
- Use a while command around a command that uses randi([0:1], [N,1]).
- N stands for the guests currently in the hotel. A result of 0 indicates the guest leaving the hotel and 1 indicates the guest staying in the hotel.
- You will need to keep track of the population at the end of each day in a separate array.
- Graph the number of people in the hotel at the beginning of each day as a scatter plot in MATLAB.
Comments
Comments
There are no comments on this resource.