terminating ALL m-scripts
显示 更早的评论
hi all,
I'm currently working on TargetLink Code generation and I am facing problem to terminate the whole process if a problem is found:
>tl_generate_code.m
> tl_eval_hook.m
> pre_codegen_hook.m
"*pre_codegen_hook*.m" is called by "tl_eval_hook.m", which is likewise called by "tl_generate_code.m".
The problem I'm facing now is that I don't know how to terminate the WHOLE process if i find problem in the called script "*pre_codegen_hook*.m". I tried using the command "return" but it only brings me to the caller and it doesn't terminate the whole process. Although this is actually about TargetLink but I guess this is applicable in normal MATLAB script.
回答(1 个)
Robert Cumming
2011-5-5
use error
help error
6 个评论
Qi Hao Goh
2011-5-5
Robert Cumming
2011-5-5
is it in a try catch block?
Qi Hao Goh
2011-5-5
Robert Cumming
2011-5-5
It will go into the catch part and then continue with the calling function. If you want it to throw an error use rethrow or similar
Qi Hao Goh
2011-5-5
Robert Cumming
2011-5-5
afraid not - apart from exit! Which will ofcourse close matlab itself...
类别
在 帮助中心 和 File Exchange 中查找有关 Language Support 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!