MathGroup Archive 2008

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

Search the Archive

Re: subscripted function arguments

  • To: mathgroup at smc.vnet.net
  • Subject: [mg85008] Re: subscripted function arguments
  • From: Yaroslav Bulatov <yaroslavvb at gmail.com>
  • Date: Tue, 22 Jan 2008 05:39:01 -0500 (EST)
  • References: <fmml10$f5t$1@smc.vnet.net>

On Jan 16, 8:19 pm, Yaroslav Bulatov <yarosla... at gmail.com> wrote:
> If I use Symbolize to treat all subscripted variables as symbols, how
> can I generate those symbols programmatically?
>
> Suppose x_1,x_2 are a symbolized subscripted variables. I'd like to do
> something like
>
> Symbolize[TagBox[SubscriptBox....
> expr=x_1+x_2
> vars=Table[Subscript[x,i],{i,2}]
> f=Function@@{{vars},expr}
>
> then
> f[1,1] should evaluate to 2

I got the answer from "Halabund" in mathematica chatroom on freenode
--
To generate subscripted variables after subscript boxes are set to be
symbolized I need to:
vars=ToExpression /@ Table["\!\(k\_" <> ToString[i] <> "\)", {i, 1,
10}]

Apparently this is described in tutorial/StringRepresentationOfBoxes.
This page seems hard to find in Mathematica 6, I don't see it linked
from any related pages.


  • Prev by Date: Export pipe problem
  • Next by Date: Re: Question: how does mathematica determine the coefficient of the
  • Previous by thread: subscripted function arguments
  • Next by thread: What is the algorithm Mathematica uses to detrmine the automatic range for plotting?