7 Calculations | 122
Operators Arguments Evaluation
- ~ ! unary Right-to-left
** binary Left-to-right
* / % binary Left-to-right
+ - binary Left-to-right
< > <= >= = binary Left-to-right
BIT_AND & binary Left-to-right
BIT_XOR ^ binary Left-to-right
BIT_OR | binary Left-to-right
AND && binary Left-to-right
XOR ^^ binary Left-to-right
OR || binary Left-to-right
?: ternary Right-to-left
, binary Left-to-right
For details of the operators, see the toolbox in the calculated signals editor.
7.2.4.3 Reduction
A reduction function is a function that takes a sequence of values and calculates
a single result value, the reduction.
reduction = Reduce(value[1], …, value[n])
Examples:
The sum of all values:
reduction = value[1] + … + value[n]
The number of samples:
reduction = n
The average of all values:
reduction = (value[1] + … + value[n]) / n
A reduction behavior is a calculation operation, that internally uses a reduction
function.
Example:
The rolling average operation applies the average at every sample position to the
last length samples of the input to determine a new output sample.
output[i] = Average(input[i-length+1], …, input[i])
Here the reduction function "average" is used by the reduction behavior "rolling".
MDA V8 | User Guide