MathGroup Archive 2002

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

Search the Archive

RE: Plot Random Walk!

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34400] RE: [mg34388] Plot Random Walk!
  • From: "Curt Fischer" <cfisher at bio.titech.ac.jp>
  • Date: Sat, 18 May 2002 03:51:04 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Dear Andrea:

The code below does what you want.

>-----Original Message-----
>From: Andrea [mailto:cigen at hil.de]
To: mathgroup at smc.vnet.net
>Sent: Friday, May 17, 2002 19:32
>Subject: [mg34400] [mg34388] Plot Random Walk!
>
>With this procedure i plot a randomwalk
>
>RandomWalk[n_]:=NetList[#+(-1)^Random[Integer ])&,0,n]
>
>ListPlot [RandomWalk[200],PlotJoined-->True]
>
>How can i plot for example 100 random walk on the same plot??
>
>Thankyou

In[1]:=
randomWalk[n_]:=NestList[#+(-1)^Random[Integer ]&,0,n];

In[2]:=
plot[m_]:=ListPlot[randomWalk[200],DisplayFunction->Identity];

In[3]:=
Show[Table[plot[i],{i,1,100}],DisplayFunction->$DisplayFunction];

Regards,

Curt Fischer
Dept. of Bioengineering
Tokyo Institute of Technology





  • Prev by Date: Why do parentheses spuriously appear when I type in a formula?
  • Next by Date: Subscripts
  • Previous by thread: Re: Plot Random Walk!
  • Next by thread: Re: Plot Random Walk!