%% Cone Programming with Nondefault Options
% To observe the iterations of the coneprog solver, set the Display option to 'iter'.

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

% Create a second-order cone programming problem and solve it using options.

Asc = diag([1,1/2,0]);
b = zeros(3,1);
d = [0;0;1];
gamma = 0;
socConstraints = secondordercone(Asc,b,d,gamma);
f = [-1,-2,0];
Aineq = [];
bineq = [];
Aeq = [];
beq = [];
lb = [-Inf,-Inf,0];
ub = [Inf,Inf,2];
[x,fval] = coneprog(f,socConstraints,Aineq,bineq,Aeq,beq,lb,ub,options)

% Copyright 2020 The MathWorks, Inc.