[Matlab]MinmaxSelection工具箱“cannot open comopts.bat file”

在使用MATLAB R2016a的MinmaxSelection工具时遇到错误:'getmexopts [Bruno]: cannot open comopts.bat file'。原因是从MATLAB 2014a开始移除了comopts.bat文件。解决方案是下载MinmaxSelection的最新版本,该版本已针对此问题进行更新。新版本增加了针对2014年后版本的判断条件,避免调用被删除的comopts.bat。
摘要由CSDN通过智能技术生成

版本R2016a,在使用minmax_install工具时出现:

错误使用 getmexopts (line 36)
getmexopts [Bruno]: cannot open comopts.bat file

出错 minmax_install (line 20)
compiler = getmexopts('COMPILER');

进入getmexopts函数,看到调用程序如下:

if ispc()
    optpath=prefdir;
    optfile=[optpath filesep 'comopts.bat'];
    mexoptfile=[optpath filesep 'mexopts.bat'];

原因分析:prefdir指向了“C:\Users\*****\AppData\Roaming\MathWorks\MATLAB\R2016a”这样的路径,但是找不到comopts.bat文件,所以报错。

解决方案:在Mathwork中官方找到了解释:在Matlab2014a以后的版本就删除了comopts.bat这个文件,解决方法下载最新的minmax_install工具箱:MinMaxSelection下载,最新版在2016年针对这个问题更新过。

新旧版本对比如下:(红色部分为新版本加入的判断条件)

if ispc() && datenum(version('-date')) < datenum('January 11, 2014')
    compiler = getmexopts('COMPILER');
    islcc = strcmpi(compiler,'lcc');

如果检测到版本在2014之后,就不会执行下面的getmexopts调用。用最新的工具箱就没问题了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值