Programmatically override a parameter in a configuration reference and set a value that is different from the referenced configuration set.
Open the model slexConfigSetRefExample
, which uses a configuration reference as the active configuration.
Check if the model has any overridden parameters.
The model does not have any overridden parameters. For this example, override the parameter ModelReferenceMinAlgLoopOccurrences
. This parameter attempts to eliminate artificial algebraic loops involving references to this model. In the referenced configuration set, the parameter is disabled. For the model slexConfigSetRefExample
, enable the parameter by overriding it.
Verify that the parameter ModelReferenceMinAlgLoopOccurrences
is overridden and check its value for the model.
Restore the parameter to the value in the referenced configuration set. Restoring the parameter makes it read-only again.
If multiple parameters are overridden for the model, you can interact with all of them at once. For example, override the parameters StartTime
, StopTime
, and SolverType
. Then, use the function configset.reference.getOverriddenParameters
to see a list of the overridden parameters.
ans = 3x1 string
"StartTime"
"StopTime"
"SolverName"
Now, restore all of the overridden parameters for the model. The parameters reset to the values in the referenced configuration set and become read-only again.