stateVector.couple
Couple variables in a state vector
Syntax
Description
Couples all the variables in the state vector to one another. Coupled variables are required to have matching metadata within ensemble members of a state vector ensemble. This ensures that, within an ensemble member, the data from different variables all align to the same point. By default, all variables in a state vector are automatically coupled to one another, so this method is only necessary if you have previously disabled autocoupling.
When the ensemble dimensions of a variable are changed, the ensemble dimensions of coupled variables will be updated to match. Note that this update does not copy reference/state indices across variables. Only the status of a dimension as an ensemble/state dimension is updated. For this syntax, the first variable in the state vector is used as a template variable; the ensemble dimensions and autocoupling settings of all other variables will be updated to match those of the template.
obj = obj.couple(variableNames)
Couples the listed variables to one another. Coupling is transitive, so any unlisted variables that are already coupled to the listed variables will also be coupled. The first listed variable is used as the template variable; the ensemble dimensions and autocoupling settings of all variables being coupled will be updated to match this template.
obj = obj.couple(variables, templateName)
Specify the variable to use as a template. All listed variables, as well as unlisted variables already coupled to the listed variables, will be coupled to this template. The ensemble dimensions and autocoupling settings of all variables being coupled will be updated to match this template.