【 CPLEX安装】

系列文章目录

提示:版本匹配matlab2019b+cplex12.10.0.0

版本查询网址:
https://www.ibm.com/software/reports/compatibility/clarity/productsForPrereq.html

在这里插入图片描述
在这里插入图片描述

一、CPLEX安装

例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。
在这里插入图片描述
python E:\software\Cplex\python\setup.py install
在这里插入图片描述
file:///E:/software/Cplex/README.html

在这里插入图片描述

二 将路径加入matlab

在这里插入图片描述

测试代码如下:

yalmiptest
在这里插入图片描述

%定义变量

x=sdpvar(2,1);

%目标函数

obj=2*x(1)+3*x(2);

%约束条件

constraint=[];

constraint=[constraint,x(1)+x(2)>350];

constraint=[constraint,x(1)>100];

constraint=[constraint,2*x(1)+x(2)<600];

constraint=[constraint,x(2)>0];

%求解

ops = sdpsettings('solver','cplex','verbose',1);

ops.cplex.display='on';

ops.cplex.timelimit=600;

ops.cplex.mip.tolerances.mipgap=0.001;

% 诊断求解可行性

disp('开始求解')

diagnostics=optimize(constraint,obj,ops);

if diagnostics.problem==0

  disp('Solver thinks it is feasible')

elseif diagnostics.problem == 1

  disp('Solver thinks it is infeasible')

  pause();

else

  disp('Timeout, Display the current optimal solution')

end

参考网站

安装教程
https://blog.csdn.net/wuxiaolongah/article/details/120339847
下载网址
https://www.cnblogs.com/elapsetor/p/16048027.html
跑猫情况:
https://blog.csdn.net/weixin_47365903/article/details/120887893

  • 1
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值