Is there a way to make try-catch statements in mex files?

纵然是瞬间 提交于 2019-12-10 17:09:46

问题


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?


回答1:


You can write your MEX-files in C++ and use the C++ exception handling.



来源:https://stackoverflow.com/questions/17190465/is-there-a-way-to-make-try-catch-statements-in-mex-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!