How to kill error dialog ?

While a long run of large loop (hours) on EXE mode, sometimes I have error (most on copy/write file). I want that in case of an error (never mind which) -> just to close the error dialog automatically (and kill my running EXE). Can anyone help?

回答 (1 件)

Guillaume
Guillaume 2016 年 7 月 14 日

0 投票

The application terminated dialog is generated by Windows and at this point your application does not have control anymore. In brief, once the dialog has appeared, there's nothing you can do about it.
However, you can prevent the dialog from appearing in the first place by wrapping the offending code in a try...catch statement and exit your program if an error is caught.
try
%...
%code that is likely to cause an error
%...
catch
%an error has occured. Take corrective action
%This could just be terminating
return;
end

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

タグ

質問済み:

2016 年 7 月 14 日

回答済み:

2016 年 7 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by