Best way to store multiple lists of different sizes?
- To: mathgroup at smc.vnet.net
- Subject: [mg48625] Best way to store multiple lists of different sizes?
- From: Jonathan Greenberg <greenberg at ucdavis.edu>
- Date: Tue, 8 Jun 2004 00:48:16 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I'm running a model which produces lists of different lengths after each
iteration, and I want to somehow store them so I can do calculations on the
lists after all the model runs are finished -- is there some sort of
variable that can handle this? For instance:
Iteration 1:
A={1,2,3,4}
Iteration 2:
A={1,2}
Iteration 3:
A={1,2,3,4,5,6}
I'd like some sort of storage variable that is:
B={1,2,3,4},{1,2},{1,2,3,4,5,6}
So I can access the list doing this such as Length[B[[1,All]]] -> 4,
Length[B[[2,All]]] -> 2, etc... Thoughts?
--j
--
Jonathan Greenberg
Graduate Group in Ecology, U.C. Davis
http://www.cstars.ucdavis.edu/~jongreen
http://www.cstars.ucdavis.edu
AIM: jgrn307 or jgrn3007
MSN: jgrn307 at msn.com or jgrn3007 at msn.com