Average function

The Average function determines the average value for the sets of numeric nodes in all parameters.

If you use literal numbers or the results of other functions as parameters to this function, the numbers are added to the total. They are also counted as nodes to determine the average.

Parameter: input, input...

The numeric nodes to calculate an average from. These can come from recurring or nonrecurring source nodes, the results of other functions, or values that you specify.

You cannot specify a default value (or constant) for the input parameters of this function but you can specify a variable with a default value and then pass that variable as an input parameter to this function.  For more information, see Specifying Default Values for Functions that Allow Recurring Nodes as Input.   
Attention: In the Mapping Editor, if you chain together a recurring source node, a function that does not support recurring nodes, and then map that result to this function, during run time you may get an unexpected result.  For more information, see Limitations in Combining Other Math Functions or Literals.

Returns: number

The average value of all parameters. This returns NaN (not a number) in the following cases:
  • If any parameters are not numeric nodes.
  • If both the sum of all values and the count of node sets are zero (the average of 0 / 0).