Documenting an evolving Simulink model

7 次查看(过去 30 天)
I am running a script that loops through parameters and runs Simulink for each combination. At the end of each model run, I save key results and the parameters in a mat file. But the model itself is changing as we improve the algorithm. In the same mat file, I would also like to save information on the model setup/topology at a level sufficient to identify if differences in the results are due to differences in the model. (We do not presently use version control software).
What is the best way to save the model setup, if it can be done? My default solution is to save the *.mdl file for each model run, which seems inefficient.

采纳的回答

Kaustubha Govind
Kaustubha Govind 2012-2-22
By model setup - if you mean just parameters, then you can of course make them all workspace variables and save the values of those variables in a MAT-file for each run. You can also store your Configuration Parameters setting, by getting the ConfigSet object using the getActiveConfigSet function and save that object also in the MAT-file. However, to save the topology itself, the only other way (besides saving the entire .mdl file) that I can think of is to use the XML Comparison Report that you can save as a ZIP-file. I think you need access to Simulink Report Generator to use the tool though.
  1 个评论
K E
K E 2012-2-23
(You are correct: XML tools require the report generator license). My coworker pointed out that fread could be used to read the mdl file into a variable ('modelText') that is saved in the run's mat file. If I later needed to determine which version of the model was used during the run, modelText could be written to a mdl file, which I could then open to examine the model topology. What do you think?

请先登录,再进行评论。

更多回答(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