%% Return All Outputs
% Solve the mixed-integer linear programming problem described in Solve Integer Programming Problem with Nondefault Options  and examine all of the output data.

x = optimvar('x',2,1,'LowerBound',0);
x3 = optimvar('x3','Type','integer','LowerBound',0,'UpperBound',1);
prob = optimproblem;
prob.Objective = -3*x(1) - 2*x(2) - x3;
prob.Constraints.cons1 = x(1) + x(2) + x3 <= 7;
prob.Constraints.cons2 = 4*x(1) + 2*x(2) + x3 == 12;

[sol,fval,exitflag,output] = solve(prob)

% For a problem without any integer constraints, you can also obtain a nonempty Lagrange multiplier structure as the fifth output.
% Copyright 2012 The MathWorks, Inc.