Comparing .mdl and .slx

12 次查看(过去 30 天)
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?

采纳的回答

Christiaan
Christiaan 2015-4-29
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

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by