设置了Gurobi的MATLAB界面


设置了Gurobi的MATLAB界面

为了使用我们的MATLAB界面,你需要使用MATLAB函数gurobi_setup告诉MATLAB去哪里找Gurobi墨西哥人文件。此文件存储在< installdir > / matlab您的Gurobi安装目录。例如,如果您在默认位置安装了64位Windows版本的Gurobi 9.1,则应该运行

> > cd c: /用户/琼斯/ gurobi912 / win64 / matlab
> > gurobi_setup

gurobi_setup函数调整MATLAB路径以包含< installdir > / matlab目录中。如果您想避免每次启动MATLAB时都输入此命令,请遵循由gurobi_setup来永久地调整你的道路。

MATLAB的例子提供了与Gurobi分布包括在< installdir > / / matlab例子目录中。要运行这些示例,您需要切换到此目录。例如,如果你运行的是64位Windows版本的Gurobi,你会说:

琼斯> > cd c: /用户/ / gurobi912 win64 /例子/ matlab
> > mip1

如果成功安装了Gurobi包,您应该会看到以下输出:

status: 'OPTIMAL' versioninfo: [1x1 struct] runtime: 2.9397e-04 objval: 3x: [3x1 double] slack: [2x1 double] poolobjbound: 3 pool: [1x2 struct] mipgap: 0 objbound: 3 objboundc: 3 itercount: 0 baritercount: 0 nodeccount: 0 x1 y 0 z 1 Obj: 3.000000e+00