Programming Previous page   Next Page

Setting the Value of Timer Object Properties

To set the value of a timer object property, use the set function or subscripted assignment (dot notation). You can also set timer object properties when you create the timer object. For more information, see Creating Timer Objects.

The following example uses both methods to assign values to timer object properties. The example creates a timer that, once started, displays a message every second until you stop it with the stop command.

  1. Create a timer object.
  2. Assign values to timer object properties using the set function.
  3. Assign a value to the timer object TimerFcn property using dot notation.
  4. Start the timer object. It displays a message at 1-second intervals.
  5. Stop the timer object.
  6. Delete timer objects after you are done using them.

Viewing a List of All Settable Properties

To view a list of all timer object properties that can have values assigned to them (in contrast to the read-only properties), use the set function, specifying the timer object as the only argument.

The display includes the values you can use to set the property if, like the BusyMode property, the property accepts an enumerated list of values.


Previous page  Retrieving the Value of Timer Object Properties Starting and Stopping Timers Next page

© 1994-2005 The MathWorks, Inc.