Hello to every one,
Well the problem i have is that i am having an array of 219 elements and every 26 elements i want to take an average.Can please someone suggest a code solution for that?
Solved! Go to Solution.
Asuming you want the average of the 26 sample sets you need to wire the Length in Gerds example also.
while your suggestion is really good (scalable, well written), you are missing imho one wire: The length of each "chunk" should most probable be 26!
Another question which comes to my mind is:
Gerds suggestion chunks the array , so you will get 219/26 = 8 chunks. Each chunk should most probable suffix to the the previous one without having overlapping. Please verify this.
The other option would be to have a "moving average".
hope this helps,
A slightly modified version of GredW's code.
(I always like to play with array :))
Hi to all,
yes, I forgot to wire the "Length" input of the ArraySubset function. But this was noticed easily...
Using DeleteFromArray is forcing shuffling of the array content. Using ArraySubset should be more memory-efficient (and probably faster for big arrays).