MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Array reference help please

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73295] Array reference help please
  • From: rob <robIV at piovere.com>
  • Date: Fri, 9 Feb 2007 23:41:36 -0500 (EST)

I've managed to get this code working but I'm stumped on a 
good way to refer to the entries in the data when plotting. 
The only thing I can get to work is to refer to the first of 
each pair as Part[data[[i]],1] and the second as 
Part[data[[i]],2].

And more humiliating, the second one I have to spell out 
twice. I tried all kinds of substitutions but failed. I know 
you gurus here know how to make this code look better and 
run more quickly. Thanks for your time.



α=100;(* decay parameter*)

(* first parameter is pulse amplitude, second is time of 
occurrence - later to follow Poisson *)

data=Table[Random[],{40},{2}];

li=Length[data];

Plot[Sum[
         Part[data[[i]],1]  UnitStep[t-Part[data[[i]],2]]
         Exp[-α (t-Part[data[[i]],2])],  {i,li}
         ]
   ,{t,0,1}]


  • Prev by Date: Re: Unwrap list of angles
  • Next by Date: Re: Fitting data to a curve
  • Previous by thread: Publicon style sheets
  • Next by thread: Re: Array reference help please