Setting up Gurobi for MATLAB

To begin, you'll need to tell MATLAB where to find the Gurobi routines. We've provided a script to assist you with this. The Gurobi MATLAB setup script, gurobi_setup.m, can be found in the <installdir>/matlab directory of your Gurobi installation (the default <installdir> for Gurobi 9.1.2 is /opt/gurobi912/linux64 for Linux). To get started, type the following commands within MATLAB to change to the matlab directory and call gurobi_setup:

>> cd /opt/gurobi912/linux64/matlab
>> gurobi_setup

You will need to be careful that the MATLAB binary and the Gurobi package you install both use the same instruction set. You need to install the 64-bit version of MATLAB to use Gurobi.

Try Gurobi for Free

Choose the evaluation license that fits you best, and start working with our Expert Team for technical guidance and support.

Evaluation License
Get a free, full-featured license of the Gurobi Optimizer to experience the performance, support, benchmarking and tuning services we provide as part of our product offering.
Academic License
Gurobi supports the teaching and use of optimization within academic institutions. We offer free, full-featured copies of Gurobi for use in class, and for research.
Cloud Trial

Request free trial hours, so you can see how quickly and easily a model can be solved on the cloud.