有没有办法在mex文件中进行try-catch语句? [英] Is there a way to make try-catch statements in mex files?
本文介绍了有没有办法在mex文件中进行try-catch语句?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
你可以在C ++中编写MEX文件,并使用 C ++异常处理。
I know that there is no built-in way to do try-catch statements in C, but has MATLAB facilitated any type of try-catch functionality for MEX files? I tried to use Longjmp
and Setjmp
in the way described in http://www.di.unipi.it/~nids/docs/longjump_try_trow_catch.html, but I was not successful. Has anyone else figured out a way?
解决方案
You can write your MEX-files in C++ and use the C++ exception handling.
这篇关于有没有办法在mex文件中进行try-catch语句?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文