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 />

Always delete timer objects when you are done using them. See “Deleting<br />

Timer Objects from Memory” on page 10-23 for more information.<br />

Timer Object Naming<br />

<strong>MATLAB</strong> assigns a name to each timer object you create. This name has the<br />

form 'timer-i', wherei is a number representing the total number of timer<br />

objects created this session.<br />

For example, the first time you call the timer function to create a timer object,<br />

<strong>MATLAB</strong> names the object timer-1. If you call the timer function again to<br />

create another timer object, <strong>MATLAB</strong> names the object timer-2.<br />

<strong>MATLAB</strong> keeps incrementing the number associated with each timer object it<br />

creates, even if you delete the timer objects you already created. For example,<br />

if you delete the first two timer objects and create a new object, <strong>MATLAB</strong><br />

names it timer-3, even though the other two timer objects no longer exist<br />

in memory. To reset the numeric part of timer object names to 1, execute<br />

the clear classes command.<br />

10-6

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

Saved successfully!

Ooh no, something went wrong!