MathGroup Archive 1997

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

Search the Archive

Creating table with multiple lists


I'm trying to create a table with multiple lists that have the same
starting value. Here's the basic code:

z=NormalDistribution[0,1];
t=100; x=0;
path=Table[x=x+Random[z], {t}]

This code will generate a continuous path starting at x=0, which is what I
want. My goal is to repeat the process multiple times, but starting each
new iteration with x=0 while storing each path. This For loop works, but
I'm looking for a better way to do it.

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? I'd like to avoid AppendTo
if possible.Thanks--any comments appreciated.

Ed McCarthy


  • Prev by Date: Any uses for SequenceHold ?
  • Next by Date: Need a new type of Hold
  • Previous by thread: Re: Any uses for SequenceHold ?
  • Next by thread: Re: Creating table with multiple lists