I have an array and want to build a loop which averages every second value starting at the first value of the array and after the first round the loop should start with the second value of the array.
For example:
3,6,18,10,2
The result should be:
7.666,8,10
for 7.6666= (3+18+2)/3
for 8= (6+10)/2
for 10=(18+2)/2
Thanks in advance