stateVector.dimensions

Return the dimensions associated with state vector variables


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

v

vector, logical | linear indices [nVariables] | -1
The indices of the variables in the state vector for which to return dimension names. If -1, selects all variables in the state vector.

variableNames

string vector [nVariables]
The names of variables in the state vector for which to return dimension names.

cellOutput

scalar logical | string scalar
Whether to always return output as a cell. When 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.

Output Arguments

dimensions

string row vector | cell vector [nVariables] {string row vector}
The dimensions associated with each specified variable. If multiple variables are specified, dimensions is a cell vector with one element per variable. Each element holds the names of the dimensions associated with the variable. If a single variable is specified and cellOutput is false, returns the list of dimensions directly as a string row vector.