I create a timer with a starting function 'StartFcn' and the timer function 'TimerFcn' and start the timer with a 3 second delay using a STARTAT function:
function simpletimerdisp('Beginning of the simple timer function') function starttimer(varargin) disp('Executing StartFcn'); end function testtimer(varargin) disp('Executing TimerFcn'); endt = timer('TimerFcn', @testtimer, 'StartFcn', @starttimer);startat(t,now+3/24/60/60);disp('End of simple timer function')end
I expect the following sequence of the messages displayed:
Beginning of the simple timer function End of simple timer function Executing StartFcn Executing TimerFcn
Instead, I get the following sequence of outputs:
Beginning of the simple timer function Executing StartFcn End of simple timer function Executing TimerFcn
Best Answer