Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

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



  • Prev by Date: FullSimplify with ForAll
  • Next by Date: LogIntegral^(-1)
  • Previous by thread: Re: FullSimplify with ForAll
  • Next by thread: Re: Best way to store multiple lists of different sizes?