% % Copyright: MOSEK ApS % % File: rmt.c % % Purpose : Template for use with solve.mosek.com clear prob; clear param; %% BEGIN PROBLEM SETUP % A simple test problem prob.a = sparse(1000,1); % 0 linear constraints, 1 variable prob.c = [1.0]'; % Only objective coefficient prob.blx= [2.0]'; % Lower bound(s) on variable(s) prob.bux= [3.0]'; % Upper bound(s) on variable(s) param = []; %% END PROBLEM SETUP % OptServer data optserver.host = 'http://solve.mosek.com:30080'; % Perform the optimization with full log output. [r,res] = mosekopt('minimize echo(10)', prob, param, [], optserver); % Handle some errors if strfind(res.rcodestr, 'MSK_RES_ERR') fprintf('Error: %s (%d) %s.\n', res.rcodestr, res.rcode, res.rmsg); if strcmp(res.rcodestr, 'MSK_RES_ERR_SERVER_PROBLEM_SIZE') fprintf("Error: the problem was too big for the demo server.\n"); end else if strcmp(res.rcodestr, 'MSK_RES_TRM_USER_CALLBACK') fprintf("Note: demo server time limit was reached.\n"); end % Proceed to retrieve problem status and solution % ... end