stateVector.autocouple

Set whether variables are automatically coupled to new variables in the state vector


Syntax



Description

obj = obj.autocouple

Indicate that all variables currently in the state vector should be automatically coupled to new variables added to the state vector. Coupling is transitive, so all variables in the state vector will also be coupled to one another.

obj = obj.autocouple(setting)
obj = obj.autocouple(true|”a”|”auto”|”automatic”)
obj = obj.autocouple(false|”m”|”man”|”manual”)

Indicate whether the variables in the state vector should be automatically coupled to new variables or not. If indicating that the current variables should automatically be coupled to new variables, then the all variables currently in the state vector will also be coupled to one another.

obj = obj.autocouple(setting, -1)
obj = obj.autocouple(setting, v)
obj = obj.autocouple(setting, variableNames)

Specify whether the listed variables should be automatically coupled to new variables added to the state vector. Coupling is transitive, so changes to autocouple settings can change the coupling status of other variables in the state vector.

If you remove variables from a set of autocoupled variables, then the listed variables will be uncoupled from the remaining variables in the autocoupling set. However, the variables removed from the autocoupling set will remain coupled to one another.

If you add variables to the set of autocoupled variables, then any unlisted variables that are already coupled to the listed variables will also be added to the set of autocoupled variables. If there are already variables in the autocoupling set, then the new variables will all be coupled to the existing autocoupled variables and will use the existing autocoupled variables as a coupling template. If there are no existing autocoupled variables, then the first listed variable will be used as the coupling template.

obj = obj.autocouple(true, variables, t)
obj = obj.autocouple(true, variables, templateName)

Specify the coupling template to use when initializing a set of coupled variables. This syntax can only be used when there are no previously existing autocoupling variables.


Input Arguments

setting

scalar logical | string scalar
Whether the variables should be automatically coupled to new variables.

[true|”a”|”auto”|”automatic”]: Automatically couple the variables

[false|”m”|”man”|”manual”]: Do not automatically couple the variables

v

logical vector | linear indices | -1
The indices of variables in the state vector that should have their autocoupling settings updated. A logical vector with one element per state vector variable, or a vector of linear indices. If -1, selects all variables in the state vector.

variableNames

string vector
The names of variables in the state vector that should have their autocoupling settings updated.

t

logical vector | linear index
The index of the variable that should be used as the coupling template for a new set of autocoupled variables.

templateName

string scalar
The name of a variable that should be used as the coupling template for a new set of autocoupled variables.

Output Arguments

obj

scalar stateVector object
The state vector with updated autocoupling settings.