comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Cumulative sum
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Cumulative sum [message #33711 is a reply to message #33710] Thu, 16 January 2003 12:14 Go to previous messageGo to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
"R. Kyle Justice" <rkj@dukebar.crml.uab.edu> wrote in message
news:b072o8$6j0$1@SonOfMaze.dpo.uab.edu...
> Is there a function for computing the cumulative sum of
> an array (similar to matlab's cumsum)?
>
> For instance: cumsum(indgen(5)) = [1,3,6,10,15]
>
> Kyle J.

See the CUMULATIVE keyword for the TOTAL function:

"If this keyword is set, the result is an array of the same size as the
input, with each element, i, containing the sum of the input array elements
0 to i. This keyword also works with the Dimension parameter, in which case
the sum is performed over the given dimension."

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Push value onto an array?
Next Topic: plotting particle data with halos?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:09:30 PDT 2025

Total time taken to generate the page: 0.32107 seconds