MathGroup Archive 2006

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

Search the Archive

structure array equivalent in Mathematica

  • To: mathgroup at
  • Subject: [mg67162] structure array equivalent in Mathematica
  • From: "kevin_jazz" <kevinbowman at>
  • Date: Sun, 11 Jun 2006 02:17:30 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Like many people I imagine, I'm transitioning to Mathematica from a
background in another system.
One of the common data types is the structure array.  Let's say I have
an observational data set that includes pressure, temperature, and
water vapor as a function of altitude.  So, in pseudo-code I might
define a structure as

observation = {pressure: float(100), temperature: float(100),
water_vapor: float(100)}

I could then access the elements of this observation as

observation.temperature, etc.

Furthermore, I could aggregate these observations into a larger list, e.g.
obs_day = {observation, observation, observation}
to be accessed as
obs_day[1].pressure for the first element (assuming 1-index).

Now, the list in Mathematica is quite powerful and I think can be
set-up in a similar fashion.

So my question is how is the structure array commonly implemented in
Mathematica or its equivalent?

If there is a previous thread (I looked but didn't find any) on the
topic or in the Mathematica book or Mathematica Journal that I missed,
feel free to point me in that direction.

Many thanks,

Kevin Bowman
Jet Propulsion Laboratory

  • Prev by Date: Re: No StringCompare in Mathematica?
  • Next by Date: Re: ? about Rule
  • Previous by thread: Re: ? about Rule (rewritten)
  • Next by thread: RE: structure array equivalent in Mathematica