LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a running sum of elements in an array?

i.e Array1 = 2,3,5,1,4 -> Array2 = 5,10,11,15
0 Kudos
Message 1 of 6
(3,101 Views)
I am confused as to what you want to sum...

do you want to sum 2,3,5,1,4 etc...

or do you want to sum 2,5 3,10 5,11 etc... ???

Dan
0 Kudos
Message 2 of 6
(3,101 Views)
I want to have a running sum of an array, for example, that is 2,3,5,1,4 and get an array with that running sum 5,10,11,15.
0 Kudos
Message 3 of 6
(3,101 Views)
You can use e.g. the code of the attached image.
Message 4 of 6
(3,101 Views)
Small Correction: I did not notice that you apparently don't want the first element, and the result should be smaller by one. In this case, simply clip the first element from the output (e.g. as shown in the image using array subset starting at element 1).
0 Kudos
Message 5 of 6
(3,101 Views)
Perfect, Thank you.
0 Kudos
Message 6 of 6
(3,101 Views)