LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

cummulative sum elements in array(one by one)

Dear All:
         I have a big problem that I want the elements in array cummulative sum one by one, such that I want the original array
 A = [5,7,11,15,16], after operation, it will get another array B = [5,12,23,38,54]! Can anyone help me? Thanks for your help!
 
0 Kudos
Message 1 of 8
(5,646 Views)

This is actually really simple and would be a good excercise in learning LabVIEW fundamentals. You can use a for loop with a shift register and an add function. If you need help in learning LabVIEW, you should check out the resources at http://www.ni.com/devzone/lvzone/fundamentals.htm.

Try to write something and if you get stuck, post the code you have written. I think that's the best way to learn and not just be handed an answer.

Message 2 of 8
(5,642 Views)
I am so sorry that I also can't find out the correct way to create the array what I wanted  through using "for loop",
please help me to solve the problem.
Thanks a lot!
0 Kudos
Message 3 of 8
(5,609 Views)
Why don't you attach a picture of what you have tried? I suspect that this is a homework problem and I don't think you will learn much if you are just given the answer.
Message 4 of 8
(5,602 Views)
Dear Dennis Kn…
Thank you every much, I just found the way to solve the problem, this is not homework, this is my project (final year), anyway, thank you for your teaching....
0 Kudos
Message 5 of 8
(5,587 Views)

It is 11 years after the question. 

 

 

0 Kudos
Message 6 of 8
(3,680 Views)

Hi student,

 

why don't you use an autoindexing output tunnel?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 7 of 8
(3,669 Views)

@Gerd - it is a subset of something else.  Basically, you are right and that is a better way to go.

0 Kudos
Message 8 of 8
(3,654 Views)