Problem with 'timer object'

2 次查看(过去 30 天)
Jmentday
Jmentday 2013-3-14
StartFcn event occurred at 14-Mar-2013 18:00:21
My start message
StopFcn event occurred at 14-Mar-2013 18:00:21
My stop message
Warning: You are deleting one or more running timer objects. MATLAB has automatically
stopped them before deletion.
not:
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
-delete(t) is executed before t.TimerFcn being executed....why? Thanks

回答(1 个)

Vishal Rane
Vishal Rane 2013-3-15
编辑:Vishal Rane 2013-3-15
Are you running those commands one by one in the command window OR in the form of a script ?
If those commands are in the form of a script, then probably the 'delete(t)' command deletes the timer object before any of the callbacks are executed.
To get the output shown, run till the start(t) command only.

类别

Help CenterFile Exchange 中查找有关 Code Execution 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by