Comparing .mdl and .slx

17 ビュー (過去 30 日間)
Tim Busfield
Tim Busfield 2015 年 4 月 28 日
コメント済み: Tim Busfield 2015 年 4 月 29 日
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 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
  1 件のコメント
Tim Busfield
Tim Busfield 2015 年 4 月 29 日
Thanks very much


その他の回答 (0 件)


Community Treasure Hunt

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

Start Hunting!

Translated by