Re: how to differentiate a list?
- To: mathgroup at smc.vnet.net
- Subject: [mg25960] Re: [mg25940] how to differentiate a list?
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Tue, 14 Nov 2000 03:46:53 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I don't think there is a list operation which will accomplish what you want. However, you may use Rest[sd] - Drop[sd, -1] which a neater way to get your diff. Tomas Garza Mexico City "Rob" <piovere at pdq.net> wrote: > I needed to get the derivative of a time varying pulse to do some > numerical > operations. As seen below, the only way I could figure how to do it > was to generate two lists, shifted by one sample and then subtract them: > > *************** > del = 0.002; a = 12\[Pi]; b = \[Pi]; > ( s[t] is a function of t defining the pulse ) > > sd = Table[N[s[t]], {t, 0, 1, del}]; > sd1 = Table[N[s[t]], {t, del, 1 + del, del}]; > diff = sd - sd1; > **************** > > I looked all over and I didn't find a list operation available to do > this. I bet > you Mathematica gurus know how to do this. If so, could you enlighten me?