linprog

Mathematical Programming

Linear programming via HiGHS: minimize f'*x subject to A*x <= b, Aeq*x = beq, lb <= x <= ub. Returns {x, fval, exitflag, output}.

Syntax

linprog(f, A, b)
linprog(f, A, b, Aeq, beq)
linprog(f, A, b, Aeq, beq, lb, ub)

Examples

% Minimize x+y subject to x+y >= 10
result = linprog([1, 1], [-1, -1], [-10])
▶ Run
% With bounds
result = linprog([1, 2], [1, 1], [5], [], [], [0, 0], [3, 3])
▶ Run

See Also

Try SimLab — Free MATLAB® Alternative

466 functions. Runs in your browser. No install.

Open SimLab

Stay Updated

Get notified about new simulations and tools. We send 1-2 emails per month.