1. Export the MATLAB data without solving anything
sdpsettings('solver','gurobi')
2. Export MATLAB model before solving (model saved to gurobidebug.mat)
ops = sdpsettings('solver','gurobi','savedebug',1)
solvesdp(constraints,objective,ops)
load gurobidebug
1 and 2 followed by
params = model.params;
params.ResultFile = 'mymodel.mps';
params.TimeLimit = 1;
gurobi(model, params);
3.Or tell gurobi to output model
ops = sdpsettings('gurobi.ResultFile','mymodel.mps');
solvesdp(constraints,objective,ops)
You might want to set time-limit parameter to 0 if you don't want gurobi to actually solve the problem