Skip to main content
1-Visitor
February 18, 2011
Solved

Vectors and Cumulative Summation

  • February 18, 2011
  • 6 replies
  • 6969 views

Hello everyone. I need help programming a loop that can calculate a cumulative running sum given a vector of values. For example, if cell(1,1) = 10 and cell(1,2) = 2, then the cumulative sum would be 12 and if cell(1,3)=4, then the cumulative sum would be cell(1,1)+cell(1,2)+cell(1,3)=16. I need to have a matrix that shows the incremental values in Col(1) and the cumulative sums in Col(2). I've attached a worksheet that resembles the type of data and loop format that I need to build.

Thanks!!

Best answer by MikeArmstrong

Something like the attached?

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

6 replies

1-Visitor
February 18, 2011

Something like the attached?

Mike

http://communities.ptc.com/servlet/JiveServlet/showImage/2-149416-2532/bar_anim.gif

amaurer1-VisitorAuthor
1-Visitor
February 18, 2011

Perfect. Thanks for your help, Mike. I appreciate the rapid responses!!!!

Anne

1-Visitor
February 18, 2011

Another way

Unk424.gif

Mike