Re: Mapping a pure function with 2 conponents.
- To: mathgroup at smc.vnet.net
- Subject: [mg77248] Re: Mapping a pure function with 2 conponents.
- From: David Reiss <dbreiss at gmail.com>
- Date: Wed, 6 Jun 2007 06:55:12 -0400 (EDT)
- References: <f43i20$3hl$1@smc.vnet.net>
So, in effect you are wanting a functoin of one variable that you take Parts of. This should do the trick: > Map[#[[1]]^2 + #[[2]] &, {{0, 1}, {2, 3}, {4, 5}}] --David http://scientificarts.com/worklife Now Mathematica 6 compatible.... On Jun 5, 7:39 am, phoenix7... at gmail.com wrote: > I'm trying to get the following code to work: > > Map[#1^2 + #2 &, {{0, 1}, {2, 3}, {4, 5}}] > > The goal is to use a pure function in order to achieve the result: > {1, 7, 21} > > The issue is that the evaluation involves #1^2 + #2 & [{0,1}] > instead of #1^2 + #2 & [0,1] > > Thanks, in advance.