Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

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

Search the Archive

Re: Array reference help please

  • To: mathgroup at
  • Subject: [mg73327] Re: [mg73295] Array reference help please
  • From: "Chris Chiasson" <chris at>
  • Date: Mon, 12 Feb 2007 05:05:19 -0500 (EST)
  • References: <>





On 2/9/07, rob <robIV at> wrote:
> 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: Curve-fitting/data analysis question...
  • Next by Date: Re: Eigensystem
  • Previous by thread: Re: Array reference help please
  • Next by thread: Re: Array reference help please