stateVector.design

Design the dimensions of variables in a state vector


Syntax



Description

obj = obj.design(-1, …)
obj = obj.design(v, …)
obj = obj.design(variableNames, …)

Designs the dimensions of the listed variables. If the first input is -1, applies the design settings to all variables currently in the state vector.

obj = obj.design(variables, dimensions, types)
obj = obj.design(variables, dimensions, 0|”c”|”current”|[])
obj = obj.design(variables, dimensions, 1|”s”|”state”)
obj = obj.design(variables, dimensions, 2|”e”|”ens”|”ensemble”)

Specifies the types of the listed dimensions. The listed dimensions will be set as ensemble dimensions, state dimensions, or kept in their current state. Ensemble dimensions are used to select the members of a state vector ensemble. State dimensions are used to select data elements along each state vector. When variables are first initialized, all dimensions are set to state dimensions. You must select at least one ensemble dimension in order to build a state vector ensemble.

If a single dimension type option is provided, applies the same setting to all listed dimensions. Otherwise, provide multiple dimension type options to select different settings for different dimensions.

obj = obj.design(…, indices)

Specify state and/or reference indices for the indices dimensions. Indices for state dimensions (state indices) indicate which elements along the dimension should be used in the state vector. Indices for ensemble dimensions (reference indices) are use as the reference points for selecting ensemble members.


Input Arguments

v

logical vector | linear indices | -1
The indices of variables in the state vector that should be designed. Either a logical vector with one element per state vector variable, or a vector of linear indices. If linear indices, may not contain repeated indices. If -1, selects all variables in the state vector.

variableNames

string vector
The names of variables in the state vector whose dimensions should be designed. May not contain repeated variable names.

dimensions

string vector [nDimensions]
The names of dimensions that should be designed. Each dimension must occur in all listed variables. Cannot have repeated dimension names.

types

scalar | vector [nDimensions], string | integer
The type of each dimension. Options are:

[0|”c”|”current”|[]]: (default) Leave in current state

[1|”s”|”state”]: State dimension

[2|”e”|”ens”|”ensemble”]: Ensemble dimension

If types is scalar, uses the same setting for all indicated dimensions. Otherwise, types must have one element per listed dimension.

indices

cell vector [nDimensions] {[] | logical vector [dimension length] | vector, linear indices}
State and reference indices for the designed dimensions. State indices are used for state dimensions; they indicate which elements along the dimension should be included in the state vector. Reference indices are used for ensemble dimensions; they indicate the elements along the dimension that can be used as reference elements for ensemble members.%

In most cases, indices should be a vector with a set of indices for each listed dimension. Each set of indices must either be a logical vector the length of the dimension, a set of linear indices, or an empty array. If the indices for a dimension are an empty array, selects all elements along the dimension as state/reference dimensions. If indices are linear indices, they cannot contain repeat elements.

If only a single dimension is listed, the dimension’s indices may be provided directly as a vector, instead of in a scalar cell. However, the scalar cell syntax is also permitted.


Output Arguments

obj

scalar stateVector object
The state vector updated with the designed variables and dimensions.