Set Configuration Parameters Programmatically - MATLAB & Simulink (original) (raw)
Main Content
In Stateflow® charts in Simulink® models, you can use the command-line API to change the settings in the Configuration Parameters dialog box.
- At the MATLAB® command prompt, store the Simulink.ConfigSet (Simulink) object that contains the configuration parameters for the current model.
configSet = getActiveConfigSet(gcs) - To get the current value of a configuration parameter, call the get_param (Simulink) function:
get_param(configSet,"parameter_name") - 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 theCommand-Line Information section:
- Solver Pane (Simulink)
- Data Import/Export (Simulink)
- Stateflow Diagnostics (Simulink)
- Simulation Target (Simulink)
- Code Generation (Simulink Coder)
- Code Generation Custom Code (Simulink Coder)
See Also
get_param (Simulink) | set_param (Simulink)
Topics
- Set Model Configuration Parameters for a Model (Simulink)
- Configure Code Generation Parameters for Model Programmatically (Simulink Coder)
- Recommended Settings Summary for Model Configuration Parameters (Simulink Coder)