MathGroup Archive 2006

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

Search the Archive

Re: RandomList and pure function


Marc,

Your code seems to be incorrect. Is this what you want?

n = 100; lis = Table[Random[Real, {0, 1}], {n}, {2}]
(#[[1]] + 2  #[[2]]) & /@ lis


Cheers,

Brian


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


  • Prev by Date: Re: RandomList and pure function
  • Next by Date: Curiosity concerning transformation rules for List
  • Previous by thread: Re: RandomList and pure function
  • Next by thread: Re: RandomList and pure function