Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: ReplaceAll and rules from a list v7.0

  • To: mathgroup at smc.vnet.net
  • Subject: [mg104382] Re: ReplaceAll and rules from a list v7.0
  • From: kristoph <kristophs.post at web.de>
  • Date: Thu, 29 Oct 2009 03:00:23 -0500 (EST)
  • References: <200910240640.CAA07557@smc.vnet.net> <hc38dt$i6c$1@smc.vnet.net>

On 26 Okt., 05:26, Matthias Greiff <gre... at mac.com> wrote:
> Kristoph,
> you can define the function and then use the Map-command:
>
> x[{a_, b_}] := a + b
> l = {{1, 1}, {2, 2}, {3, 3}}
> x /@ l
>
> or
>
> x[{a_, b_}] := a + b
> l = {{1, 1}, {2, 2}, {3, 3}}
> Map[x, l]
>
> This gives you {2,4,6}.
>
> Best,
>
> Matthias
>
> Am 24.10.2009 um 24. Oktober , 08:40:20 schrieb kristoph:
>
> > Hi,
>
> > Suppose I have the equation
>
> > x=a+b
>
> > and the list
>
> > l={{1,1},{2,2},{3,3}}
>
> > How can I quickly assign the list to the above equation, that is, I
> > would like to get the following result
>
> > {2,4,6}
>
> > The first element of each sub-list should be assigned to a and the
> > second to b.
>
> > Thanks in advance.
> > Kristoph

Thanks for all the great answers.
Kristoph


  • Prev by Date: ToExpression[..,TexForm] does not seem to work on some Latex commands?
  • Next by Date: Re: problem of syntax.
  • Previous by thread: Re: ReplaceAll and rules from a list v7.0
  • Next by thread: Re: ReplaceAll and rules from a list v7.0