Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #1789

Converting list of subscripted variables into an array

From "Christopher O. Young" <cy56@comcast.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Converting list of subscripted variables into an array
Date 2011-04-20 08:27 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <iom5dr$t7p$1@smc.vnet.net> (permalink)

Show all headers | View raw


I have a long list that's supposed to represent points on 9 different
curves. I'd like to put them into an array C[j,k] where j is the index for
the curves and k is the index for the points.

Subscript[c1, 1] = {1.796875, 1.34375}

Subscript[c1, 2] = {2.15625, 1.34375}

Subscript[c1, 3] = {2.296875, 1.359375}

Subscript[c1, 4] = {2.375, 1.46875}

Subscript[c1, 5] = {2.46875, 1.671875}
......

I'm new at pattern matching, and I'm having a hard time getting started
here. Can anyone steer me in the right direction?

Chris Young
cy56@comcast.net
IntuMath.org

In[180]:= "c" <> IntegerString[1]


Out[180]= "c1"




In[181]:= Subscript["c" <> IntegerString[1], 2]


Out[181]= Subscript["c1", 2]




In[182]:= Evaluate[%]

In[183]:= Subscript["c1", 2]


Out[183]= Subscript["c1", 2]




ToExpression[Subscript["c1", 2]]



During evaluation of In[187]:= ToExpression::notstrbox: Subscript[c1, 2] is
not a string or a box. ToExpression can only interpret strings or boxes as
Mathematica input. >>



Out[187]= $Failed




In[188]:= ToExpression[RowBox[{Subscript["c1", 2]}]]



During evaluation of In[188]:= ToExpression::esntx: Could not parse
RowBox[{Subscript[c1, 2]}] as Mathematica input. >>



Out[188]= $Failed




Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread


Thread

Converting list of subscripted variables into an array "Christopher O. Young" <cy56@comcast.net> - 2011-04-20 08:27 +0000

csiph-web