dash.stateVectorVariable.mean

Take a mean over dimensions of a state vector variable


Syntax



Description

obj = obj.mean(dims, indices, omitnan, header)

Takes a mean over the specified dimensions given mean indices and NaN options.

obj = obj.mean(dims, “none”, [], header)

Disables the mean over the specified dimensions.

obj = obj.mean(dims, “unweighted”, [], header)

Discards weights for weighted means of the specified dimensions.


Input Arguments

dims

vector, linear indices [nDimensions]
The indices of the dimensions over which to take a mean.

indices

cell vector [nDimensions] {[] | mean indices}
Mean indices for the dimensions. An empty array for state dimensions, and additive indices for ensemble dimensions.

omitnan

logical vector [nDimensions]
Whether to omit NaN elements along a mean (true) or whether to include NaN (false)

Output Arguments

obj

scalar dash.*stateVectorVariable* object
The variable updated with the new mean parameters.