How to export Simulink models (with Stateflow components) to XML ?

28 views (last 30 days)
Hello,
I would need to know how can I export Simulink models (and some of these latter may also have Stateflow components, such as State Charts etc.) to XML.
I have typed the following MATLAB commands:
modelName = 'sf_aircraft' % model of the name without extension
save_system(modelName, 'xml_model.xml', 'ExportToXML', true)
But I have the following warning :
Warning: The 'ExportToXML' option is no longer supported and will be removed in a future release.
And I have also noticed that in the XML file the State Chart component is just mentioned, so basically I cannot see what it contains from the XML file.
So what I would like to ask is if there are other functions or ways that allow Simulink models with State Charts components to be exported in a XML format.
Thanks in advance.

Answers (1)

Corey Lagunowich
Corey Lagunowich less than a minute ago
Edited: Corey Lagunowich less than a minute ago
Stateflow's model format is readable, but not open. You should not need to directly read or write SLX model files, as this format may change without prior notice.
What are you trying to achieve?
  1. If you want to modify your Simulink or Stateflow models, please use the Simulink and Stateflow APIs as referred in the documentation.
  2. If you're looking to improve compatibility and interoperability with git, register the SLX format following this doc page. You can use Simulink's diff and merge tools to understand what has changed between two different designs.

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

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

Start Hunting!