フィルターのクリア

Workaround for external program crashing

2 ビュー (過去 30 日間)
KAE
KAE 2017 年 10 月 11 日
編集済み: KAE 2017 年 10 月 11 日
I have a Matlab script that calls an external program someProgram as follows,
eval(['!someProgram.exe ' arg1 ' ' arg2])
where arg1 and arg2 are calculated by my Matlab script, and someProgram is within a try/catch loop in my Matlab script. Occasionally someProgram crashes and hangs and I have to manually close a Windows error window until my Matlab script resumes. I would like my Matlab script to move on to the next loop iteration instead. From Matlab, is it possible to kill the process if it takes more than a certain time? I suspect the solution lies outside Matlab, but any ideas would help.
  1 件のコメント
KAE
KAE 2017 年 10 月 11 日
編集済み: KAE 2017 年 10 月 11 日
I tried the approach here, which is to pause for the expected length of someProgram runtime, then kill someProgram. The down side is that each loop iteration now includes a pause command which adds time if someProgram executes without hanging.

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2017 年 10 月 11 日
Can you try to use system()? It returns status that you might be able to use.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by