MathGroup Archive 1999

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

Search the Archive

Re: List of function-heads

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17115] Re: List of function-heads
  • From: "David Bailey" <dave-bailey at freeuk.com>
  • Date: Sat, 17 Apr 1999 03:35:10 -0400
  • References: <7f1g3u$ku0@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

I like that technique! You were very nearly there, but you assigned to fl,
not to the value of fl. The following code works as desired:

fl=Table[a[i][x_],{i,2}]

Evaluate[fl]={x^2,x-1}

Now we find that say:

a[2][y]

gives the desired result:

-1+y

David Bailey db at salford-software.com


Peter Breitfeld wrote in message <7f1g3u$ku0 at smc.vnet.net>...
>I want to create a List of function-heads like this:
>{a[1][x_],a[2][x_],...,a[n][x_]}
>(to keep this message short I'll use n=2 in the following) to assign
>these to a list of Functions, e.g
>
>{a[1][x_],a[2][x_]}={x^2,x-1}
>
>I can do that with the following command:
>
>In[1]:=fl=Table[a[i][x_],{i,2}]
>Out[1]={{a[1][x_],a[2][x_]}
>
>But then I can't write:
>
>ll={x^2,x-1}
>
>because now the a[i] are overwritten and not assosiated with the
>elements of the rhs.
>
>Is there a way to get it working? I tried Thread, MapThread and some
>more but didn't find a solution.





  • Prev by Date: Rationalizing Fractions
  • Next by Date: Re: List of function-heads
  • Previous by thread: Re: List of function-heads
  • Next by thread: Re: List of function-heads