05-10-2012 02:22 AM
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.
05-10-2012 02:42 AM
05-10-2012 02:59 AM
Asuming you want the average of the 26 sample sets you need to wire the Length in Gerds example also.
/Y
05-10-2012 03:02 AM
Gerd,
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!
@gstathatos:
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,
Norbert
05-10-2012 03:09 AM
A slightly modified version of GredW's code.
(I always like to play with array :))
05-10-2012 03:15 AM
Hi Gerd,
Your suggestion code work as i expected and many thakns for that.
05-10-2012 04:52 AM - edited 05-10-2012 04:53 AM
Hi to all,
yes, I forgot to wire the "Length" input of the ArraySubset function. But this was noticed easily...
@P Anand:
Using DeleteFromArray is forcing shuffling of the array content. Using ArraySubset should be more memory-efficient (and probably faster for big arrays).