創(chuàng)建定時(shí)器對(duì)象:語(yǔ)法: T = timer[創(chuàng)建一個(gè)默認(rèn)狀態(tài)的定時(shí)器對(duì)象]T = timer('access arguments passed to it.t.StartFcn = {'my_callback_fcn', 'My start message'};3、Specify the value of the StopFcn callback. The example specifies the callback function by its handle, rather than as a text string. Again, the value is specified in a cell array because the callback function needs to access the arguments passed to it.t.StopFcn = { @my_callback_fcn, 'My stop message'};4、Specify the value of the TimerFcn callback. The example specifies the MATLAB commands in a text string.t.TimerFcn = @(x,y)disp('Hello World!'); 5、Start the timer object.start(t) The example outputs the following.StartFcn event occurred at 10-Mar-2004 17:16:59 My start message Hello World! Hello World! StopFcn event occurred at 10-Mar-2004 17:16:59 My stop message 6、Delete the timer object after you are finished with it.delete(t)