stateVector.sequence

Use a sequence of data along ensemble dimensions


Syntax



Description

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

Creates sequences for the listed variables. If the first input is -1, applies a sequence to every variable currently in the state vector.

obj = obj.sequence(variables, dimensions, indices, metadata)

Design sequences for the listed ensemble dimensions. Sequences are built using the provided sequence indices. Each set of sequence indices is associated with a provided set of metadata.

obj = obj.sequence(variables, dimensions, “none”)

Removes any sequences from the listed dimensions.


Input Arguments

v

logical vector | linear indices | -1
The indices of variables in the state vector that should be given a sequence. 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 that should be given a sequence. May not contain repeated variable names.

dimensions

string vector
The names of the ensemble dimensions that should be given a sequence. Each dimension must be an ensemble dimension in all listed variables. Cannot have repeated dimension names.

indices

cell vector [nDimensions] {sequence indices | []}
The sequence indices to use for each dimension. Sequence indices how to select state vector elements along ensemble dimensions. For each ensemble member, the sequence indices are added to the reference index, and the resulting elements are used as state vector rows. If the ensemble dimension also uses a mean, the mean indices are applied at each sequence element.

indices should be a cell vector with one element per listed dimension. Each element contains the sequence indices for the corresponding dimension or an empty array. Sequence indices are 0-indexed from the reference element for each ensemble member and may include negative values. If an element of indices contains an empty array, then any pre-existing sequences are removed for that dimension. The sequence metadata for that dimension must also be an empty array.

If only a single dimension is listed, you may provide the sequence indices directly as a vector, instead of in a scalar cell. However, the scalar cell syntax is also permitted.

metadata

cell vector [nDimensions] {metadata matrix [nSequenceIndices x ?]}
Sequence metadata for each listed dimension. Sequence metadata is used as the unique metadata marker for each sequence element along the state vector.

metadata should be a cell vector with one element per listed dimension. Each element holds the sequence metadata for the correpsonding dimension. Each set of metadata must be a matrix with one row per associated sequence index. Each metadata matrix should have unique rows.

Metadata matrices may have a numeric, logical, char, string, cellstring, or datetime data type. They cannot contain NaN or NaT elements. Cellstring metadata will be converted to string. If there are no sequence indices for a dimension, then the sequence metadata for the dimension should be an empty array.

If only a single dimension is listed, you may provide sequence metadata directly as a matrix, 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 new sequence parameters.