% YALMIP + MOSEK example
%
% Demonstrates how to set MOSEK parameters and dump task files from YALMIP

m = 30;
n = 20;
A = randn(m,n);
b = randn(m,1);

x = sdpvar(n,1);
objective = norm(A*x - b);
constraints = [0 <= x, x <= 1];

% Optimize the problem
% mosek.*      - MOSEK parameters identified by generic names 
% verbose      - enable full log
% mosektaskfile- where to save the data file
ops = sdpsettings('solver', 'mosek', ...
                  'mosek.MSK_DPAR_OPTIMIZER_MAX_TIME', 100.0, ...
                  'mosek.MSK_IPAR_INTPNT_SOLVE_FORM', 'MSK_SOLVE_DUAL', ...
                  'verbose', 1, ...
                  'mosektaskfile', 'dump.task.gz');
optimize(constraints, objective, ops);

x
