MathGroup Archive 1997

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

Search the Archive

Re: Creating table with multiple lists


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