Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Generate #s

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111008] Re: Generate #s
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Fri, 16 Jul 2010 06:59:31 -0400 (EDT)

Hi,

the problem is not that it doesn't work. The problem is, that the parts
of # you want to acces doesn't exist (except for the first one #[[1]]).
Therefore,

example = {1, 5, 7, 9};
Table[#[[i]], {i, example}]

works as expected. Without knowing what you want to do it's quite hard
to help you here.

Cheers
Patrick 

On Fri, 2010-07-16 at 05:16 -0400, Francisco Gutierrez wrote:
> 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: local or global variables
  • Next by Date: Re: Generate #s
  • Previous by thread: Re: Generate #s
  • Next by thread: Re: Generate #s