Comparing .mdl and .slx

12 visualizaciones (últimos 30 días)
Tim Busfield
Tim Busfield el 28 de Abr. de 2015
Comentada: Tim Busfield el 29 de Abr. de 2015
I have two Simulink models, one .mdl and one .slx. I want to confirm that the structure & functionality of the two models is the same, however the .mdl will not compile in R2014b - so I cannot use the 'Analysis > Compare Simulink XML Files' approach. Is there a way to convert the models to xml in 2010b and 2014b respectively and compare outside of Matlab (ie using diff tool) and how (dis)similar are the xml structures of .mdl and .slx models?

Respuesta aceptada

Christiaan
Christiaan el 29 de Abr. de 2015
Dear Mr. Busfield,
As you may already know SLX is a compressed package that conforms to the Open Packaging Conventions (OPC) interoperability standard. SLX stores model information using Unicode® UTF-8 in XML and other international formats. Therefore in Simulink it is easy to export an slx file to an xml file.
What you may can try is to write the following in the MATLAB prompt:
>> save_system('model.mdl', 'model_xml.xml','ExportToXML', true);
A second possibility is that you save the mdl file in Simulink (2014 Version) to a slx file. In principle, if you upgrade an MDL file to SLX file format, the file contains the same information as the MDL file, and you always have a backup file. Now you could compare the xml files.
More information can be found in this documentation.
Kind regards, Christiaan

Más respuestas (0)

Categorías

Más información sobre Programmatic Model Editing en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by