Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to play with some linear programming examples of Mathematica as ExampleData[{"LinearProgramming", "blend"}, "Equations"]. It gives me the MPS format of the samples. How can I change them?

share|improve this question
You've seen this? – J. M. May 6 '13 at 11:13
up vote 3 down vote accepted

One thing you can do is to import in the ConstraintMatrix form.

 Import["ExampleData/afiro.mps", "ConstraintMatrix"]

This gives a SparseArray object, which can be turned back into a regular matrix format using Normal. Some other possible manipulations of the MPS data are discussed here.

share|improve this answer
Could you please show me how I can use the Normal and after changing it how having new SparseArray again? – Alex May 6 '13 at 17:52
After applying Normal it is a matrix of values and you can do anything with it you desire. If you name it (say m) then you can get back to sparse form by SparseArray[m]. – bill s May 6 '13 at 17:57

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.