/
avg (List)
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 (https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&folder=Functions&obj=objidm4y33fov8mi0o7kzn2fikvg) |
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 (https://openbrim.org/platform/?application=inc&author=ParamML_Examples_OpenBrIM+Platform&folder=Functions&obj=objidvsr47ihh7mhyn1oyu656bp) |
, multiple selections available,
Related content
getlistitem (List1, Index1, Index2) , List[Index1][Index2]
getlistitem (List1, Index1, Index2) , List[Index1][Index2]
More like this
Mathematical Functions
Mathematical Functions
Read with this
avg(Liste)
avg(Liste)
More like this
Mechanical Property Functions
Mechanical Property Functions
Read with this
sum (List, optional Startindex, optional endindex)
sum (List, optional Startindex, optional endindex)
More like this
suml(List) or suml(List of list , x[index])
suml(List) or suml(List of list , x[index])
More like this