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

Home » Public Forums » archive » Re: Cumulative total
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 total [message #12838 is a reply to message #12828] Fri, 18 September 1998 00:00 Go to previous messageGo to previous message
Andy Loughe is currently offline  Andy Loughe
Messages: 174
Registered: November 1995
Senior Member
Nice, elegant solution, Eddie.

P.S. Weren't you the kid on... Nah!

eddie haskell wrote:
>
>> Can anyone suggest a more efficient way to compute the
>> running cumulative total of a 1-D array than using FOR loops?
>
> here is the way i do it:
>
> IDL> A = findgen(10)
> IDL> N = n_elements(A)
> IDL> result = A # (lindgen(N,N) ge transpose(lindgen(N,N)))
> IDL> print,result
> 0.00000
> 1.00000
> 3.00000
> 6.00000
> 10.0000
> 15.0000
> 21.0000
> 28.0000
> 36.0000
> 45.0000
>
> cheers,
> eddie
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Help with pick menu widget code
Next Topic: Re: Search routines

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

Current Time: Sat Oct 11 05:51:01 PDT 2025

Total time taken to generate the page: 3.95283 seconds