Storing listbox values as vector.

1 view (last 30 days)
Minh Le
Minh Le on 29 Nov 2015
Commented: Jan on 29 Nov 2015
I'm doing a project about simulation of an elevator. I have created a listbox to list the floors that users can choose to go to. I want to store the values of a listbox to a vector so that I can execute the vector in proper order.
For example, the first person selects floor 3, the second person selects floor 1. Then the vector will be [3 1], thus, I can open the door on the 3rd floor and then the 1st floor.
Thank you for your help.
  2 Comments
Walter Roberson
Walter Roberson on 29 Nov 2015
That is not how elevators work. If a floor is selected that is in the current direction of travel and the newly selected floor is the closest floor to where the elevator is out of all the floors in the list, and it is safe to stop at the floor considering the speed of the elevator, then the floor will be the first one stopped at, not the last one stopped at which is what your programming would do.
Jan
Jan on 29 Nov 2015
You describe a FIFO buffer. Beside the fact that this is an unusual (but possible) method for an elevator, you did not ask a specific question. So how can we help you? What have you tried so far? Which problems occur?

Sign in to comment.

Answers (0)

Categories

Find more on Environment and Settings in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!