Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Newbie to Mathematica - how do you read in an array of subscripted variables?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg106708] Re: Newbie to Mathematica - how do you read in an array of subscripted variables?
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Thu, 21 Jan 2010 04:56:11 -0500 (EST)

On 1/20/10 at 6:47 AM, dystopian.daemon at gmail.com (Wrecktangle)
wrote:

>I am simply trying to read in a set of data for each observation
>day: each data line starts with a date and followed by observation
>type number 1, 2, 3, 4, 5, 6, 7, etc to 52 distinct
>observations. Then I'll be smoothing each observation type over
>4-8 days.

>I can get the data read in thru Import, but having trouble with
>getting subscripts working.

First, the best way to get help here is to post the Mathematica
code causing a problem for you using InputForm. That makes it
possible for someone to see exactly what you are doing and offer
specific suggestions.

The short answer to "How do you read in an array of subscripted
variables?" is you don't. The longer answer is you can make this
work but that requires reasonably advanced technique in Mathematica.

The key issue is there really isn't anything built-in to
Mathematica that behaves like a subscripted variables. In
Mathematica, variables have a Head equal to Symbol. Anything
with a subscript has a Head equal to Subscript. Mathematica
treats things with different heads differently which is the main
reason subscripted variables don't work the way you might expect
out of the box.

You can make subscripted symbols behave like in the manner you
expect for subscripted variables using the Notation package.
But, this is not an approach I would recommend.



  • Prev by Date: looping
  • Next by Date: FindMaximum/NMaximize vs. Excel Solver
  • Previous by thread: Newbie to Mathematica - how do you read in an array of subscripted variables?
  • Next by thread: simple nest