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 #33706] Thu, 16 January 2003 15:01 Go to previous message
graves is currently offline  graves
Messages: 7
Registered: September 2001
Junior Member
> 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]

The IDL equivalent is to use the total function with the cumulative
keyword, so your example would be total(indgen(5), /cumulative).





Ted
[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: Wed Oct 08 19:35:56 PDT 2025

Total time taken to generate the page: 0.00420 seconds