06-07-2017 05:25 PM
Hello All,
I have a 1D array that is being generated inside of a case. This array leads out of the case, and I want to be able to add it to the previous array created, which is why I have it in a For Loop. As you can see in the picture attached, I am trying to figure out how to correctly add the current array to the previous one, and once the for loop is done, divide the added array by the number of iterations (basically the number of arrays added). Would this give me the averaged array? I want to average the array so I can find the averaged Max of the array which is being filled in by a frequency sweep.
06-07-2017 05:39 PM
No, it will not.
On the first iteration previous array is default, it is empty. When you add data, you kill it and again write empty array into node.
Do not add, if old array is empty.
06-07-2017 05:52 PM
Thank you Alexander for getting back to me so quickly.
Yes, that was the problem I was getting a lot of.
I changed that part of the code to what is shown in the image attached, and I think it's working out well... still need to stress test to be sure.