structure array equivalent in Mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg67162] structure array equivalent in Mathematica
- From: "kevin_jazz" <kevinbowman at mac.com>
- Date: Sun, 11 Jun 2006 02:17:30 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
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.pressure
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