Main Content

Simulink.BlockDiagram.saveActiveConfigSet

Save active configuration set of model

Description

Simulink.BlockDiagram.saveActiveConfigSet(model, file) saves the active configuration set of a model to an .m file or MAT-file.

example

Examples

collapse all

Save the configuration set from the sldemo_fuelsys model as a ConfigSet object in the file my_config_set.mat.

Open the Model Fault-Tolerant Fuel Control System example model sldemo_fuelsys.

openExample('simulink_automotive/ModelingAFaultTolerantFuelControlSystemExample')
sldemo_fuelsys

Save the active configuration set.

Simulink.BlockDiagram.saveActiveConfigSet('sldemo_fuelsys','my_config_set.mat')

Input Arguments

collapse all

Name or handle of the model that uses the configuration set that you want to save, specified as a character vector or string scalar.

Example: 'my_model'

Name of the file to save the configuration set, specified as a character vector or string scalar. If you specify an .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. If you do not provide a file extension, the active configuration set is saved to a file with a .m extension. Do not specify filename to be the same as a model name; otherwise, the software cannot determine which file contains the configuration set object when loading the file.

Note

If you specify a .mat extension when you save the active configuration set, all of the parameters are preserved. If you specify a .m extension, the .m file does not include hidden or disabled parameters.

Example: 'configset.m'

Version History

Introduced in R2010b