%% Quadratic Minimization with Nondefault Options
% Set options to monitor the progress of quadprog.

options = optimoptions('quadprog','Display','iter');

% Define a problem with a quadratic objective and linear inequality constraints.

H = [1 -1; -1 2]; 
f = [-2; -6];
A = [1 1; -1 2; 2 1];
b = [2; 2; 3];

% To help write the quadprog function call, set the unnecessary inputs to [].

Aeq = [];
beq = [];
lb = [];
ub = [];
x0 = [];

% Call quadprog to solve the problem.

x = quadprog(H,f,A,b,Aeq,beq,lb,ub,x0,options)

% Copyright 2018 The MathWorks, Inc.