Info

此问题已关闭。 请重新打开它进行编辑或回答。

Disrupting a "distant" while loop

1 次查看(过去 30 天)
Michaël
Michaël 2016-3-15
关闭: MATLAB Answer Bot 2021-8-20
Hello,
if obj.State
obj.function
else
%disrupt the execution of obj.function
end
If obj.State isn't equal to 1, I'd like to disrupt the execution of the obj.function function, which includes a while 1 (infinite) loop.
What do you think?
Thank you very much
  1 个评论
dpb
dpb 2016-3-15
编辑:dpb 2016-3-15
I think it's hopeless without a way to communicate to the function other than terminating the script entirely. Also, there's no way to get from the if clause to the else one while the function is running unless you've spawned a separate process as the code is serial at that point.

回答(0 个)

此问题已关闭。

产品

Community Treasure Hunt

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

Start Hunting!

Translated by