ensembleMetadata.dimensions

Return the dimensions associated with variables in a state vector ensemble


Syntax



Description

dimensions = obj.dimensions
dimensions = obj.dimensions(-1)

Return the names of dimensions associated with each variable in the state vector.

dimensions = obj.dimensions(v)
dimensions = obj.dimensions(variableNames)

Return the names of dimensions associated with the specified state vector variables.

dimensions = obj.dimensions(…, type)
dimensions = obj.dimensions(…, 0|’a’|’all’|[])
dimensions = obj.dimensions(…, 1|’s’|’state’)
dimensions = obj.dimensions(…, 2|’e’|’ens’|’ensemble’)

Specify the type of dimension to return for each variable. Options are all dimensions, state dimensions, or ensemble dimensions. By default, returns all dimensions for each variable.

dimensions = obj.dimensions(…, type, cellOutput)
dimensions = obj.dimensions(…, type, true|’c’|’cell’)
dimensions = obj.dimensions(…, type, false|’d’|’default’)

Specify whether output should always be organized in a cell. If false (default), dimensions for a single variable are returned as a string row vector. If true, dimensions for a single variable are returned as a string row vector within a scalar cell. Dimensions for multiple variables are always returned as a cell vector of string row vectors.


Input Arguments

variableNames

string vector
The names of variables for which to return dimension names.

v

-1 | logical vector | vector, linear indices
The indices of variables in the state vector for which to return dimension names. If -1, selects all variables. If a logical vector, must have one element per variable in the state vector.

type

string scalar | scalar positive integer
Indicates which types of dimension names to return

[0|”all”|”a” (default)]: Returns the names of all dimensions for each variable

[1|”state”|”s”]: Returns the names of state dimensions.

[2|”ensemble”|”ens”|”e”]: Returns the names of ensemble dimensions

cellOutput

string scalar | scalar logical
Whether to always return output as a cell.

[“cell”|”c”|true]: Always returns outputs in a cell, even the dimensions for a single variable.

[“default”|”d”|false]: Dimensions for a single variable are returned directly as a string vector.


Output Arguments

dimensions

string vector | cell vector [nVariables] {string vector}
The names of the dimensions for the listed variables. If a single variable is listed and cellOutput is on the default setting, a string vector with one element per listed dimension. If multiple variables are listed, a cell vector with one element per listed variable. Each element holds the names of the dimensions for a listed variable.