MATLAB: How to extract configuration parameters from a model

simulink

I want to save all the config params from a model so that I can use the same set in another model. How can I do that?

Best Answer

You can save the settings of configuration sets as MATLAB® functions or scripts. Using the MATLAB function or script, you can share and archive model configuration sets. You can also compare the settings in different configuration sets by comparing the MATLAB functions or scripts of the configuration sets.
To save an active or inactive configuration set from the Model Explorer:
  1. Open the model.
  2. Open the Model Explorer.
  3. Save the configuration set:
  • In the Model Hierarchy pane:
  • Right-click the model node and select Configuration > Export Active Configuration Set.
  • Right-click a configuration set and select Export.
  • Select the model. In the Contents pane, right-click a configuration set and select Export.
  • In the Export Configuration Set to File dialog box, specify the name of the file and the file type. If you specify a .m extension, the file contains a function that creates a configuration set object. If you specify a .mat extension, the file contains a configuration set object.
  • Click Save. The Simulink® software saves the configuration set.
You can load configuration sets that you previously saved as MATLAB functions or scripts.
To load a configuration set from the Model Explorer:
  1. Open the model.
  2. Open the Model Explorer.
  3. In the Model Hierarchy pane, right-click the model and select Configuration > Import.
  4. In the Import Configuration Set From File dialog box, select the .m file that contains the function to create the configuration set object, or the .mat file that contains the configuration set object.
  5. Click Open. The Simulink software loads the configuration set.
  6. Optionally, activate the configuration set. For more information, see Activate a Configuration Set.
Related Question