# MPS file generation

I have a code in MATLAB which uses YALMIP to structure my optimization model and solve it via a solver. I would like to obtain a .mps file out of my model, apparently, YALMIP does not produce this if I am not mistaken. I would like to obtain a .mps file, how can I do this?

Edit: I know this is not an OR question, but I am sure a lot of OR people may face this challenge someday.

• I think, this is an OR question :) – Marco Lübbecke Oct 30 '19 at 10:09
• at least not theory :P – independentvariable Oct 30 '19 at 10:55

I am not an expert in YALMIP but you may check the saveampl(F,h,filename) command written in YALMIP website. An example of the implementation is given as:

x = sdpvar(3,1);
A = randn(5,3);
b = randn(5,1);
c = randn(3,1);
F = [A*x <= b, integer(x(2:3))];
saveampl(F,c'*x,'myamplmodel.mod');


where I think you can save the model with .mps extension instead of .mod.

• I think this is wrong since  saveampl exports a YALMIP model to an AMPL model.  – independentvariable Oct 29 '19 at 16:25
• @independentvariable, as I mentioned you may save it as .mps by changing .dat to .mps where the saveampl gives the option to mention the extension of your file in the command. – Oguz Toragay Oct 29 '19 at 16:36