23.06.2015 Views

MATLAB Programming

MATLAB Programming

MATLAB Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

10<br />

Scheduling Program<br />

Execution with Timers<br />

<strong>MATLAB</strong> includes a timer object that you can use to schedule the execution<br />

of <strong>MATLAB</strong> commands. This chapter describes how you can create timer<br />

objects, start a timer running, and specify the processing that you want<br />

performed when a timer fires. A timer is said to fire when the amount of<br />

time specified by the timer object elapses and the timer object executes the<br />

commands you specify.<br />

Using a <strong>MATLAB</strong> Timer Object<br />

(p. 10-3)<br />

Creating Timer Objects (p. 10-5)<br />

Working with Timer Object<br />

Properties (p. 10-7)<br />

Starting and Stopping Timers<br />

(p. 10-10)<br />

Creating and Executing Callback<br />

Functions (p. 10-14)<br />

Timer Object Execution Modes<br />

(p. 10-19)<br />

Step-by-step procedure for using a<br />

timer object with a simple example<br />

Using the timer function to create<br />

a timer object<br />

Setting timer object properties and<br />

retrieving the values of timer object<br />

properties<br />

Using the start or startat function<br />

to start timer objects; using the stop<br />

function to stop them, and blocking<br />

the command line<br />

Creating a callback function and<br />

specifying it as the value of a timer<br />

object callback property<br />

Using the ExecutionMode property<br />

to control when a timer object<br />

executes

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!