Storing listbox values as vector.

1 vue (au cours des 30 derniers jours)
Minh Le
Minh Le le 29 Nov 2015
Commenté : Jan le 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 commentaires
Walter Roberson
Walter Roberson le 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 le 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?

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by