Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

Re: RandomList and pure function

  • To: mathgroup at smc.vnet.net
  • Subject: [mg70867] Re: RandomList and pure function
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Mon, 30 Oct 2006 05:32:40 -0500 (EST)

On 10/28/06 at 11:38 PM, marcvial at msn.com (Marc VIAL) wrote:

>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?

Use

(#[[1]]+2 #[[2]])&/@lis

or

Times@@@((#+{2,0})&/@lis)
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: RandomList and pure function
  • Next by Date: Re: DisplayTogether & PlotLegend incompatibility
  • Previous by thread: Re: RandomList and pure function
  • Next by thread: Re: RandomList and pure function