提示1:
错误使用 mex
调用了已弃用的 MEX 函数 mexSetTrapFlag。请更新源代码以使用 mexCallMATLABWithTrap。
提示2:
错误使用 mex
调用了已弃用的 MEX 函数 mexCallMATLAB。请更新源代码以使用 mexCallMATLABWithTrap。
原因:
从MATLAB 2018b开始正式弃用,改用2008b新增的mexCallMATLABWithTrap。
解决方法:
Step.1 查找无法通过编译的C文件,将 mexSetTrapFlag 全部注释掉(删掉)。
Step.2 将 mexCallMATLAB 替换为 mexCallMATLABWithTrap 即可运行。
R2008b
New Features, Bug Fixes, Compatibility Considerations
External Interfaces/API
New Functions to Catch Errors in MEX-Files Replace mexSetTrapFlag
Two new MEX library functions have been added to the MATLAB C and Fortran API.
The mexCallMATLABWithTrap function, like mexCallMATLAB, lets you call MATLAB functions from within a MEX-file. In addition, mexCallMATLABWithTrap lets you catch, or trap, errors. Using this function for exception handling is more flexible that using