MathGroup Archive 1997

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

Search the Archive

Re: Creating table with multiple lists

  • To: mathgroup at smc.vnet.net
  • Subject: [mg7559] Re: Creating table with multiple lists
  • From: paul at physics.uwa.edu.au (Paul Abbott)
  • Date: Fri, 13 Jun 1997 19:38:13 -0400 (EDT)
  • Organization: University of Western Australia
  • Sender: owner-wri-mathgroup at wolfram.com

Ed McCarthy wrote:

> z=NormalDistribution[0,1];
> list1={};
> For[i=0, i<10, i++,
> t=100; x=0;
> path=Table[x=x+Random[z],{t}];
> AppendTo[list1,path]]
> 
> Does any have suggestions for generating multiple paths (with x reset to 0
> for each iteration) with a functional approach? 

How about

	Table[NestList[#+Random[z]&,0,t]//Rest,{10}]

Cheers,
	Paul 

_________________________________________________________________ 
Paul Abbott
Department of Physics                       Phone: +61-8-9380-2734 
The University of Western Australia           Fax: +61-8-9380-1014
Nedlands WA  6907                         paul at physics.uwa.edu.au 
AUSTRALIA                           http://www.pd.uwa.edu.au/Paul

          God IS a weakly left-handed dice player
_________________________________________________________________


  • Prev by Date: Help: Saving/Printing graphics output
  • Next by Date: Re: combinatorics problem
  • Previous by thread: Re: Creating table with multiple lists
  • Next by thread: Re: Creating table with multiple lists