avg (List)
The function calculates the average of the elements in a specified one-dimensional list. It adds up all the values in the list and divides the sum by the number of elements to find the arithmetic mean.
Example:
avg(List) → number |
<O N="avgObject1" T="Project" Category="Functions" TransAlignRule="1">
<!-- created by ParamML Examples on 13.02.2023 -->
<P N="a" V="avg([5])" />
<P N="b" V="avg([5,5,5,5])" />
<P N="c" V="avg([5,0,10,4,6])" />
<P N="d" V="avg([3,6,7,4,-6,11,10])" />
<P N="e" V="avg([13,16,17,14,4,21,20])" />
</O> |
Debug Trace |
The result is a=b=c=d=5' and e=15. |
To view this example in the library, see (OpenBrIM Platform) |
Example:
<O N="avgObject2" T="Project" Category="Functions" TransAlignRule="1">
<!-- created by ParamML Examples on 13.02.2023 -->
<P N="A" V="avg([1,2,3,4,5])" />
<P N="B" V="avg([5,5,4,6])" />
<P N="C" V="avg([80,70,90,-90])" />
<P N="D" V="avg([3,6,7,4,64,11,10])" />
<P N="E" V="avg([0,2,4,6])" />
</O> |
Debug Trace |
To view this example in the library, see (OpenBrIM Platform) |
, multiple selections available,