Adding variables to the model

The next step adds a matrix variable to the model:

    # Create variables
    x = m.addMVar(shape=3, vtype=GRB.BINARY, name="x")

A matrix variable is added through the addMVar() method on a model object. In this case the matrix variable consists of a 1-D array of 3 binary variables. Variables are always associated with a particular model.