ensembleMetadata.variable

Return metadata for a variable in a state vector ensemble


Syntax



Description

metadata = obj.variable(v, dimension)

Returns the metadata for a particular dimension of a variable. If the dimension is a state dimension, returns the metadata down the rows of the state vector. If the dimension is an ensemble dimension, returns the metadata across the ensemble members. If the dimension is an ensemble dimension with a sequence, returns the sequence metadata down the rows of the state vector.

metadata = obj.variable(variable, dimension, variableRows)
metadata = obj.variable(variable, dimension, members)

Return metadata at the specified rows or ensemble members. Here, rows are interpreted relative to the variable’s rows, rather than all the rows in the state vector. For example, setting variableRows=1 will return metadata for the first row of the variable, regardless of the variable’s overall position in the state vector.

metadata = obj.variable(variable, dimension, type)
metadata = obj.variable(variable, dimension, “members”|”m”)
metadata = obj.variable(variable, dimension, “rows”|”r”)
metadata = obj.variable(variable, dimension, “default”|”d”)

Specify which type of metadata to return the for the dimension. If “members”|”m”, returns metadata across the ensemble members. If “rows”|”r”, returns metadata down the rows of the state vector. If “default”|”d”, behaves identically to the first syntax and decides internally which metadata to return.

metadata = obj.variable(variable, dimension, type, rows)
metadata = obj.variable(variable, dimension, type, members)

Specify both the type of metadata to return, and also the rows or ensemble members.


Input Arguments

v

logical vector | scalar linear index
The index of a single variable in the state vector. If a logical vector, must have one element per variable in the state vector and a single true element. Otherwise, use a scalar linear index.

variableName

string scalar | char row vector
The name of the variable.

dimension

string scalar | char row vector
The name of a dimension for the variable.

variableRows

logical vector | vector, linear indices
The rows of the variable at which to return metadata. If a logical vector, must have one element per row in the variable. If a vector of linear indices, elements should be between 1 and the length of the variable.

members

logical vector | vector, linear indices
The ensemble members for which to return metadata. If a logical vector, must have one element per ensemble member. Otherwise, a vector of linear indices.

type

string scalar
Indicates which type of metadata to return

[“d”|”default”]: Let the method decide which type of metadata to return

[“r”|”rows”]: Return metadata down the rows of the state vector

[“m”|”members”]: Return metadata across the ensemble members


Output Arguments

metadata

matrix | 3*D* array
The metadata for the dimension. If returning metadata for an ensemble dimension, the metadata is a matrix with one row per selected ensemble member. If returning metadata for a sequence or for a state dimension that does not implement a mean, the metadata is a matrix with one row per selected row. If returning metadata for a state dimension that implements a mean, the metadata will be a 3D array. The number of rows will match the number of requested rows, and each row will be identical. The metadata of elements used to implement the mean are organized along the third dimension.