Execute code if m-file runs into error
8 次查看(过去 30 天)
显示 更早的评论
I have tried finding the answer to this problem, but only got 'old' results which did not pose a solution. Maybe by now there is one.
I am controlling a combustion process using an m-file, which occasionally runs into errors (mostly scripting errors and typos). Having an error while the combustion is unstable, for example, is quite dangerous, so I want Matlab to execute a few lines of code whenever the m-file runs into an error. This is just simply closing the gas valve and turning the fan on.
Is there any solution for this? The problem is that most errors are scripting errors, which don't just give an error but also stop the mfile running...
Thanks!
0 个评论
采纳的回答
ES
2013-10-23
use try and catch at all suspect instances. This will solve your case.
But when you call a blob a script, it should not have scripting errors or typos;)
2 个评论
ES
2013-10-24
blob means text. If some text qualifies to be called script or code, it should atleast be free of typhos and such errors. Did not mean to hurt you:)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 MATLAB Compiler SDK 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!