Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

simultaneous pauses loop in GUI

조회 수: 1 (최근 30일)
Kuang-Yu WANG
Kuang-Yu WANG 2018년 12월 24일
마감: MATLAB Answer Bot 2021년 8월 20일
I create a function for a togglebutton for control system.
if get(togglebutton1,'value')==1
if get(checkbox1,'value')==1
if pumptime1>0
start(pump1.t)
pause(pumptime1)
stop(pump1.t)
else
start(pump1.t)
end
end
if get(checkbox2,'value')==1
if pumptime2>0
start(pump2.t)
pause(pumptime2)
stop(pump2.t)
else
start(pump2.t)
end
end
elseif get(togglebutto,'value')==0
if get(checkbox1,'value')==1
stop(pump1.t)
end
if get(checkbox2,'value')==1
stop(pump2.t)
end
end
how can I made the pause do in the sametime? please help!
  댓글 수: 3
Rik
Rik 2019년 1월 3일
Have you tried to first find out the length of every pause, and after that running them all at the same time (by having only 1 call to pause)? You can sort the pause times in ascending order and run them in a loop.
Kuang-Yu WANG
Kuang-Yu WANG 2019년 1월 4일
because my pauses are actually variables, for example if I made pumptime1 to be 5, and the other with 0, it will start pumping pump1 for 5 sec and then pumping the pump2 and 3 in same time. Therefore, I think if I use the mathod of sorting it could not work either.

답변 (0개)

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by