MathGroup Archive 2010

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

Search the Archive

Re: Generate #s

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111381] Re: Generate #s
  • From: Francisco Gutierrez <fgutiers2002 at yahoo.com>
  • Date: Thu, 29 Jul 2010 06:45:31 -0400 (EDT)

Many thanks to Jos=E9 and other group members who sent me helpful ideas (as always) to solve my query.
Fg


--- On Sat, 7/17/10, Jos=E9 Luis G=F3mez Mu=F1oz <jose.luis.gomez at itesm.mx>wrote:


From: Jos=E9 Luis G=F3mez Mu=F1oz <jose.luis.gomez at itesm.mx>
Subject: [mg111381] [mg111032] Re: Generate #s
To: mathgroup at smc.vnet.net
Date: Saturday, July 17, 2010, 7:18 AM


I assume that you know that # has a special meaning in Mathematica (
arguments of pure functions, see
http://reference.wolfram.com/mathematica/ref/Slot.html ) and that you know
that the correct syntax for this meaning is #1, #5, #7, etc. and that
#[[1]],#[[2]], etc. is NOT correct, then you can generate your list with the
correct syntax with the following command:

Map[Slot, {1, 5, 7, 9}]

Or with this:

example=={1,5,7,9}
Map[Slot,example]


HTH
Jose
Mexico


-----Mensaje original-----
De: Francisco Gutierrez [mailto:fgutiers2002 at yahoo.com]
Enviado el: Viernes, 16 de Julio de 2010 04:16 a.m.
Para: mathgroup at smc.vnet.net
Asunto: [mg110988] Generate #s

Dear Group:
Suppose I have a list of ordered integers:
example=={1,5,7,9}
Based on it, I want to generate a list of the form:
{#[[1]], #[[5]],#[[7]],#[[9]]}

I tested with simple things like:
Table[#[[example[[i]]]], {i,1,Length[example]}]
to no avail.

How can I do it?



  • Prev by Date: Re: NDSolve for catenary
  • Next by Date: Re: Substiuting variables within an integral
  • Previous by thread: Re: Generate #s
  • Next by thread: Integration by part