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 Scheduling Program Execution with Timers<br />

Finding All Timer Objects in Memory<br />

To find all the timer objects that exist in memory, use the timerfind<br />

function. This function returns an array of timer objects. If you leave off<br />

the semicolon, and there are multiple timer objects in the array, timerfind<br />

displays summary information in a table:<br />

t1 = timer;<br />

t2 = timer;<br />

t3 = timer;<br />

t_array = timerfind<br />

Timer Object Array<br />

Index: ExecutionMode: Period: TimerFcn: Name:<br />

1 singleShot 1 '' timer-3<br />

2 singleShot 1 '' timer-4<br />

3 singleShot 1 '' timer-5<br />

Using timerfind to determine all the timer objects that exist in memory can<br />

be helpful when deleting timer objects. See “Deleting All Existing Timer<br />

Objects” on page 10-23 for an example.<br />

Finding Invisible Timer Objects<br />

If you set the value of a timer object’s ObjectVisibility property to<br />

'off', the timer object does not appear in listings of existing timer objects<br />

returned by timerfind. TheObjectVisibility property provides a way for<br />

application developers to prevent end-user access to the timer objects created<br />

by their application.<br />

Objects that are not visible are still valid. If you have access to the object (for<br />

example, from within the M-file that created it), you can set its properties. To<br />

retrieve a list of all the timer objects in memory, including invisible ones, use<br />

the timerfindall function.<br />

10-24

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

Saved successfully!

Ooh no, something went wrong!