MathGroup Archive 2009

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

Search the Archive

Re: Indexed Slot in a Rule - How to do it??

  • To: mathgroup at smc.vnet.net
  • Subject: [mg100316] Re: Indexed Slot in a Rule - How to do it??
  • From: Simon <simonjtyler at gmail.com>
  • Date: Mon, 1 Jun 2009 07:05:24 -0400 (EDT)
  • References: <gvtme0$gct$1@smc.vnet.net>

Hi Alan,

You might be trying to make it a bit too complicated.
If you use the explicit form of Function I think it becomes easier, eg

In[1]:= eqs={0,5*x1,1,10*x3,3*x2};

In[2]:= T1=Function[{x1,x2,x3},{0,5 x1,1,10 x3,3 x2}];

In[2]:= T1@@{1,2,3}
Out[2]= {0,5,1,30,6}

In[3]:= T[q_List]:=Apply[T1,q]

In[4]:= T[{1,2,3}]
Out[5]= {0,5,1,30,6}

Simon


  • Next by Date: Re: Perpendicular lines do not appear perpendicular
  • Next by thread: Re: Indexed Slot in a Rule - How to do it??