User`s guide
Time Data Updates from a GUI (GUIDE)
Time Data Updates from a GUI (GUIDE)
In this section...
“About the Timer GUI Example” on page 10-105
“View and Run the GUIDE Timer GUI” on page 10-106
“Components Used by the Timer GUI” on page 10-107
“How the GUI Implements the Timer” o n page 10-109
“Other Uses for Timers in GUIs” on page 10-112
About the Timer GUI Example
This example shows how to refresh a display by incorporating a timer in a
GUI that updates data. Timers are MATLAB objects. Programs use their
properties and methods to schedule tasks, update information, and time o ut
processes. For example, you can set up a timer to acquire real-time data at
certain intervals, which your GUI then analyzes and displays.
The GU I displays a surface plot of the
peaks function and contains 3
uicontrols:
• The Start Randomizing push button — Starts the timer running, which
executes at a rate determined by the slider control. At each iteration,
random noise is added to the surface plot.
• The Stop Randomizing push button — H alts the timer, leaving the
surface plot in its current state until you click the Start Randomizing
button again.
• The Timer Period slider — Speeds up and slows down the timer, changing
its period within a range of 0 .01 to 2 seconds.
The following illustrations show the GUI. The left shows the initial state of
the GUI. The right shows the GUI after running the timer for 5 seconds at its
default period of 1 count per second.
10-105