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