STARTAT function is used to delay the execution of the TimerFcn. When the line with the STARTAT command is reached, the following sequence of events occurs:
1. The timer object's property 'StartDelay' is set to the difference between the second argument of STARTAT function and 'now'. In this example, the 'StartDelay' property will be set to 3 seconds. 'StartDelay' property of a timer object specifies the delay, in seconds, between the start of the timer and the first execution of the function specified in TimerFcn.
2. StartFcn is executed. In this example, the 'Executing StartFcn' line appears in the command prompt.
3. The TimerFcn execution is delayed until the 'StartDelay' time has elapsed. At this moment the code proceeds to execute further, displays 'End of simple timer function' and returns control to the command line. When the amount of time equal to 'StartDelay' has elapsed, the TimerFcn is executed and the 'Executing TimerFcn' message is displayed.
For an overview of the Timer object callback functions please refer to the documentation by executing the following in the MATLAB command prompt:
web([docroot '/techdoc/matlab_prog/f9-39541.html#f9-42494'])
Best Answer