05-14-2010 12:08 PM
Hello,
I want to generate a vector that is the cumulative sum of another vector without using a loop. My vector is more than 10^6 in length, and a loop takes forever. I use cumsum in matlab, but couldn't find anything analogous in labview.
Thank you!
Solved! Go to Solution.
05-14-2010 12:18 PM
05-14-2010 12:24 PM
yes, I thought about it, but I was hoping I can do the same easily without using Matlab functions. Otherwise I'll just write the whole program in Matlab.
thanks anyway!
05-14-2010 12:28 PM
05-14-2010 12:32 PM
05-14-2010 12:42 PM - edited 05-14-2010 12:43 PM
This works for a 1 d array of a million elements...you will have to mod it a bit for a 2d array but it hardly takes any time at all to execute. You must have some inefficiency in your code. If you need to do either columns or rows, I can mod it a bit for you, but you should try it on your own first using this example.
05-14-2010 01:12 PM
Thanks so much, my mistake was to disable indexing in the loop (aghhh...).
thanks all for helping.
05-14-2010 02:39 PM
05-14-2010 02:59 PM