| Simulink Reference | ![]() |
Access a model configuration set.
Description
Instances of this handle class allow you to write programs to create, modify, and attach configuration sets to models. See the Configuration Set API for more information.
Property Summary
| Name |
Description |
|
Components of the configuration set. |
|
Description of the configuration set. |
|
Name of the configuration set. |
|
Mode used to simulation this configuration. |
Note
You can use the Model Configuration dialog box to set the Name, Description, and SimulationMode properties of a model's active configuration set. See The Model Configuration Dialog Box for more information.
|
Method Summary
| Name |
Description |
|
Attach a component to a configuration set. |
|
Create a copy of a configuration set. |
|
Get a component of a configuration set. |
|
Get full path name of a configuration set. |
|
Get the handle of the model that owns a configuration set. |
|
Get the value of a configuration set parameter. |
|
Determine whether a configuration set is the active set of the model that owns it. |
|
Determine whether a specified parameter is a valid parameter of a configuration set. |
|
Prevent or allow a user to change a parameter. |
|
Set the value of a configuration set parameter. |
Properties
Components
Description: Array of Simulink.ConfigComponent objects representing the components of the configuration set, e.g., solver parameters, data import/export parameters, etc.
Description
Description: Description of configuration set. You can use this property to provide additional information about a configuration set, such as its purpose.
Name
Description: Configuration set's name.
SimulationMode
Description: Model's simulation mode. Valid values are normal, accelerator, or external.
Methods
attachComponent
Purpose: Attach a component to this configuration set.
Syntax: attachComponent(component)
Description: This method replaces a component in this configuration set with a component having the same name.
Example: The following example replaces the solver component of the active configuration set of model A with the solver component of the active configuration set of model B.
hCs = getActiveConfigSet('B'); hSolverConfig = hCs.getComponent('Solver'); hSolverConfig = hSolverConfig.copy; hCs = getActiveConfigSet('A'); hCs.attachComponent(hSolverConfig);
copy
Purpose: Create a copy of this configuration set.
Description: This method creates a copy of this configuration set.
Note
You must use this method to create copies of configuration sets. This is because Simulink.ConfigSet is a handle class. See Handle Versus Value Classes for more information.
|
getComponent
Purpose: Get a component of this configuration set.
Syntax: getComponent(componentName)
Description: Returns the specified component. Omit the argument to get a list of the names of the components that this configuration set contains.
Example: The following code gets the solver component of the active configuration set of the currently selected model.
The following code displays the names of of the components of the currently selected model's active configuration set at the MATLAB command line.
getFullName
Purpose: Get the full path name of a configuration set.
Description: This method returns a string specifying the full path name of a configuration set, e.g., 'vdp/Configuration'.
getModel
Purpose: Get the model that owns this configuration set.
Description: Returns a handle to the model that owns this configuration set.
Example: The following command opens the block diagram of the model that owns the configuration set referenced by the MATLAB workspace variable hCs.
get_param
Purpose: Get the value of a configuration set parameter.
Description: This method returns the value of the specified parameter. config.get_param('ObjectParameters') returns the names of the valid parameters in the configuration set named config.
Example: The following command gets the name of the solver used by the selected model's active configuration.
Note
You can also use the get_param model construction command to get the values of parameters of a model's active configuration set, e.g., get_param(gcs, 'SolverName', '20') gets the solver name of the currently selected model.
|
isActive
Purpose: Determine whether this configuration set is its model's active configuration set.
Description: Returns true if this configuration set is the active configuration set of the model that owns this configuration set.
isValidParam
Purpose: Determine whether a specified parameter is a valid parameter of this configuration set. A parameter is valid if it is compatible with other parameters in the configuration set. For example, if SolverType is set to 'variable-step', FixedStep is an invalid parameter.
Syntax: isValidParam(paramName)
Description: This method returns true if the specified parameter is a valid parameter of this configuration set; otherwise, it returns false.
Example: The following code sets the parameter StopTime only if it is a valid parameter of the currently selected model's active configuration set.
setPropEnabled
Purpose: Enable a configuration set parameter to be changed.
Syntax: setPropEnabled(paramName, isEnabled)
Description: This method sets the enabled status the parameter specified by paramName to the value specified by isEnabled. Disabling a parameter prevents the user from changing it.
Example: The following code prevents the user from setting the simulation stop time of the currently selected model.
set_param
Purpose: Set the value of a configuration set parameter.
Syntax: set_param(paramName, paramValue)
Description: This method sets the configuration set parameter specified by paramName to the value specified by paramValue.
Example: The following command sets the simulation stop time of the selected model's active configuration.
Note
You can also use the set_param model construction command to set the parameters of the active configuration set, e.g., set_param(gcs, 'StopTime', '20') sets the simulation stop time of the currently selected model.
|
| Simulink.BusElement | Simulink.ModelDataLogs | ![]() |
© 1994-2005 The MathWorks, Inc.