Storing listbox values as vector.

1 次查看(过去 30 天)
Minh Le
Minh Le 2015-11-29
评论: Jan 2015-11-29
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 个评论
Walter Roberson
Walter Roberson 2015-11-29
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 2015-11-29
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?

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by