ensemble.variables

Return the names of variables in an ensemble


Syntax



Description

variableNames = obj.variables

Returns the ordered list of variables in the ensemble. The index of each variable in the list corresponds to the index of the variable in the ensemble. If the “useVariables” command has been applied to the ensemble, only returns the names and indices of the variables being used by the ensemble object.

variableNames = obj.variables(v)
variableNames = obj.variables(-1)

Returns the list of variables at the specified variable indices. The order of variables in the list corresponds to the order of input indices. Variable indices are interpreted in the context of variables being used by the ensemble. If the index is -1, selects all used variables.

variableNames = obj.variables(v, scope)

Indicate the scope in which to interpret variable indices. If false|”u”|”used”, behaves identically to the previous syntax and interprets indices in the context of variables being used by the ensemble. If true|”f”|”file”, interprets indices in the context of variables saved in the .ens file. If the index is -1, returns the names of all variables within the appropriate scope.


Input Arguments

v

-1 | logical vector | linear indices
The indices of variables in the ensemble whose names should be returned. If -1, selects all variables. Depending on scope, these indices are interpreted in the context of either the variables being used by the ensemble, or the variables saved in the .ens file.

scope

string scalar | logical scalar
The scope in which to interpret indices and return variable names

[“used”|”u”|true (default)]: Return names relative to the set of variables being used by the ensemble object.

[“file”|”f|false]: Return names relative to the set of all variables stored in the .ens file.


Output Arguments

variableNames

string vector
The names of the specified variables