2

I need convert an Simulink file (.mdl) to an XML file, after any searches i'm not found any content to help me with this problem.

You'd know some way or ready solution for this in Java?

Carlos Spohr
  • 494
  • 11
  • 22

2 Answers2

4

Starting in R2008b, you can export an .mdl file to an .xml file using save_system,

>> save_system('model.mdl', 'model_xml.xml','ExportToXML', true);
MikeT
  • 1,624
  • 8
  • 11
  • Hi Mike, I had not seen his response yesterday. The R2008b it's an independent library in Java ? ...sorry for not understand :/ – Carlos Spohr Jun 13 '12 at 11:20
  • I understand your question now. You need Simulink/MATLAB in order to save the .mdl file to an XML format. I don't know of any independent Java library that can do this. – MikeT Jun 27 '12 at 01:50
0

I know of no easy solution.

However, there are a couple of libraries in Java that apparently can parse simulink files. They should be sufficient to give you an in-memory representation, and you could then use an XML binding to produce passable XML.

Stephen C
  • 632,615
  • 86
  • 730
  • 1,096
  • Hi Stephen, i found the SimulinkModelBuilder, this library loads an MDL file and i can access all file contents. What xml library can i use to serialize this object in XML notation ? – Carlos Spohr Jun 13 '12 at 01:10