stateVector.weightedTotal
Take a weighted total over dimensions of variables in a state vector
Syntax
Description
obj = obj.weightedTotal(-1, …)obj = obj.weightedTotal(variableNames, …)
Updates weighted total settings for the listed variables. If the first input is -1, applies the settings to every variable currently in the state vector.
Takes a weighted total over the indicated state dimension. You must provide a weight for each state index along the dimension.
Takes a weighted total over the indicated ensemble dimension. Before using this method, you must first use the “stateVector.total” method to provide total indices for the ensemble dimension. You must provide a weight for each total index.
Take a weighted total over multiple dimensions. If the dimension list contains ensemble dimensions, you must have first called the “stateVector.total” method on the ensemble dimensions.
Input Arguments
v
variableNames
dimensions
weights
If weights is an empty array, an unweighted total will be taken for the dimension. Otherwise, the weights for a state dimension should have one element per state index. The weights for an ensemble dimension should have one element per total index.
If only a single dimension is listed, you may provide the sequence indices directly as a vector, instead of in a scalar cell. However, the scalar cell syntax is also permitted.