Hide navigation sidebar
Hide table of contents sidebar
Back to top
Toggle table of contents sidebar

# MATLAB API Overview

This section documents the Gurobi MATLAB interface. For those of you who are not familiar with MATLAB, it is an environment for doing numerical computing. Please visit the MATLAB web site for more information. This manual begins with a quick overview of the methods provided by our MATLAB API. It then continues with a comprehensive presentation of all of the available methods, their arguments, and their return values.

For information about how to install the Gurobi MATLAB interface, please refer to the Gurobi MATLAB API installation guide.

If you are new to the Gurobi Optimizer, we suggest that you start with the Getting Started Knowledge Base article for general information. This also includes Tutorials for the different Gurobi APIs. Additionally, our Example Tour provides concrete examples of how to use the methods described here. We will point to sections or examples of this tour whenever it fits in this overview.

The MATLAB Optimization Toolbox provides its own interface for building optimization models (starting with version 2017b). Gurobi supports this interface as well. We’ll discuss this aspect in the problem-based modeling section; consult also the `linprog`, `intlinprog`, `opttoolbox_lp`, and `opttoolbox_mip1` examples in the Gurobi distribution for illustrations of how to pass models built using this interface to Gurobi.

A quick note for new users: the convention in math programming is that variables are non-negative unless specified otherwise. You’ll need to explicitly set lower bounds if you want variables to be able to take negative values.

Contents

- Overview
  - Models
  - Solving a Model
  - Multiple Solutions and Multiple Objectives
  - Infeasible Models
  - Managing Parameters
  - Monitoring Progress
  - Error Handling
  - Environments and license parameters
- Common Arguments
  - The model argument
    - Commonly used fields
    - Quadratic objective and constraint fields
    - SOS constraint fields
    - Multi-objective fields
    - Computing an IIS
    - General constraint fields
    - Advanced fields
  - The params argument
    - Using a Compute Server License
    - Using a Gurobi Instant Cloud License
- Solving a Model
  - `gurobi`
  - `gurobi`
  - `gurobi_iis`
  - `gurobi_iis`
  - `gurobi_feasrelax`
  - `gurobi_feasrelax`
  - `gurobi_relax`
  - `gurobi_relax`
- Input-Output
  - `gurobi_read`
  - `gurobi_read`
  - `gurobi_write`
  - `gurobi_write`
- Using Gurobi within MATLAB's Problem-Based Optimization
- Setting up the Gurobi MATLAB interface

Help and Feedback

Press `/` or click to search this documentation | Gurobi website | Gurobi community forum
Go to other Gurobi documentation | Gurobi download | Contact support