Continuously Update a GUIDE Object Based on Time

1 Ansicht (letzte 30 Tage)
Marc
Marc am 18 Jul. 2014
Kommentiert: Marc am 18 Jul. 2014
I have written a GUI using GUIDE. In it, I have several static text boxes that I would like to continuously update at a specified frequency (say, twice a second). These updates should be independent of the other functions in the GUI, like button clicks. What I would like to do is to have a few text boxes that continuously display the system status, like whether the power is on or off, whether it is running or not, how many cycles it has gone through...
I can update the text boxes like so:
set(handles.System_Status,'String','Running');
set(handles.Power,'String','On');
But I can only execute that code on a button press.
Is there a way to allow the code to continuously run some function in the background?

Akzeptierte Antwort

Joseph Cheng
Joseph Cheng am 18 Jul. 2014
you put the correct item in your tag. you can use the timer functionality inside the GUI.
  2 Kommentare
Joseph Cheng
Joseph Cheng am 18 Jul. 2014
place the timer initialization in either a start button or at the initialization of the GUI.
Marc
Marc am 18 Jul. 2014
Thanks Joseph. I see that now. What happens if I trigger other GUI objects at the same time as the timer function is running or is supposed to run? Will it delay one of them?

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by