Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #1835 > unrolled thread
| Started by | Alexei Boulbitch <alexei.boulbitch@iee.lu> |
|---|---|
| First post | 2011-04-22 09:40 +0000 |
| Last post | 2011-04-22 09:40 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
Re: Converting list of subscripted variables into an array Alexei Boulbitch <alexei.boulbitch@iee.lu> - 2011-04-22 09:40 +0000
| From | Alexei Boulbitch <alexei.boulbitch@iee.lu> |
|---|---|
| Date | 2011-04-22 09:40 +0000 |
| Subject | Re: Converting list of subscripted variables into an array |
| Message-ID | <iorief$o4m$1@smc.vnet.net> |
Chris,
what about the following:
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};
Clear[u];
Do[u[1, j] = Subscript[c1, j], {j, 1, 5}]
u[1, 5]
{2.46875, 1.67188}
?? I write u[i,j] instead of C[i,j], since C is protected.
Or you may make a table out of it and simultaneously the array:
tab = Table[u[1, j] = Subscript[c1, j], {j, 1, 5}]
{{1.79688, 1.34375}, {2.15625, 1.34375}, {2.29688, 1.35938}, {2.375,
1.46875}, {2.46875, 1.67188}}
u[1, 1]
{1.79688, 1.34375}
Have fun. Alexei
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 at comcast.net
IntuMath.org
--
Alexei Boulbitch, Dr. habil.
Senior Scientist
Material Development
IEE S.A.
ZAE Weiergewan
11, rue Edmond Reuter
L-5326 CONTERN
Luxembourg
Tel: +352 2454 2566
Fax: +352 2454 3566
Mobile: +49 (0) 151 52 40 66 44
e-mail: alexei.boulbitch@iee.lu
www.iee.lu
--
This e-mail may contain trade secrets or privileged, undisclosed or
otherwise confidential information. If you are not the intended
recipient and have received this e-mail in error, you are hereby
notified that any review, copying or distribution of it is strictly
prohibited. Please inform us immediately and destroy the original
transmittal from your system. Thank you for your co-operation.
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web