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

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

cvx_begin
    variable x(n);
    0 <= x;
    x <= 1;
    minimize(norm(A*x - b));

    cvx_solver mosek;
    % Set MOSEK parameters using generic names
    cvx_solver_settings('MSK_DPAR_OPTIMIZER_MAX_TIME', 100.0, ...
                        'MSK_IPAR_INTPNT_SOLVE_FORM', 'MSK_SOLVE_DUAL');
    % Shows how to save the MOSEK task file
    cvx_solver_settings('write', 'dump.task.gz')
cvx_end
