MATLAB: Linear Programming Objective Function with constant term.

linear programmingobjective-function

Hi,
I'm wondering how you represent a constant value in the LP formulation in MATLAB, using "linprog".
For example,
Min Z = 2 x1 + 3 x2 + 4 y
x1 and x2 are variables.
y is an input value, not a variable.
How to represent this in the coding?
thanks!

Best Answer

You cannot add a constant, but there shouldn't be any need to. Adding a constant to the objective function does not change the location(s) of the solutions, x.