Main Content

Set Configuration Parameters Programmatically

In Stateflow® charts in Simulink® models, you can use the command-line API to change the settings in the Configuration Parameters dialog box.

  1. At the MATLAB® command prompt, store the Simulink.ConfigSet (Simulink) object that contains the configuration parameters for the current model.

    configSet = getActiveConfigSet(gcs)
  2. To get the current value of a configuration parameter, call the get_param (Simulink) function:

    get_param(configSet,"parameter_name")
  3. To set a configuration parameter, call the set_param (Simulink) function:

    set_param(configSet,parameter_name=value)

For example, you can set the Reserved names parameter for simulation by entering:

configSet = getActiveConfigSet(gcs)
set_param(configSet,SimReservedNameArray=["abc","xyz"])

For more information on the configuration parameters that you can set programmatically, click the parameters listed on these pages and navigate to the Command-Line Information section:

See Also

(Simulink) | (Simulink)

Related Topics