MATLAB使用MEX编译C遇到弃用函数mexCallMATLAB或mexSetTrapFlag

提示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

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值