Re: RandomList and pure function
- To: mathgroup at smc.vnet.net
- Subject: [mg70863] Re: RandomList and pure function
- From: "Peter" <pjcrosbie at gmail.com>
- Date: Mon, 30 Oct 2006 05:32:27 -0500 (EST)
- References: <ei18or$8n7$1@smc.vnet.net>
There is only one argument passed to the pure function and it is a list. Use the following to access elements of the list: (#[[1]] + 2 #[[2]]) & /@ lis Marc VIAL wrote: > Hi, > > Sorry for this naive question, but I try to apply a pure function of 2 arguments to a list of n rows with 2 clm using the mapping function: > > n=100;lis=RandomReal[{0,1},{n,2}]; > (#1+2 #2)&/@lis > > however it only captures the first term in the list and leave #2 unassigned. > > Any advice? > > Thanks > Marc > _________________________________________________________________