Re: "Accumulate" with operator Times.
- To: mathgroup at smc.vnet.net
- Subject: [mg114891] Re: "Accumulate" with operator Times.
- From: Peter Breitfeld <phbrf at t-online.de>
- Date: Tue, 21 Dec 2010 00:21:51 -0500 (EST)
- References: <iemq88$m7m$1@smc.vnet.net>
Matthias Bode wrote:
> Hola:
>
> In[5]:= Accumulate[{a, b, c}] yields
>
> Out[5]= {a, a + b, a + b + c}
>
> Is there a simple command, similar to Accumulate, that yields
>
> {a, a*b, a*b*c} ?
>
> Best regards,
>
> MATTHIAS BODE
> S 17.35775=B0, W 066.14577=B0
> 2'740 m
> AMSL.
>
I don't know of a build in command, but you might use FoldList:
Rest@FoldList[Times,1,{a,b,c}]
Out= {a,a b, a b c}
--
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de