Re: Generate #s
- To: mathgroup at smc.vnet.net
- Subject: [mg111010] Re: Generate #s
- From: Bob Hanlon <hanlonr at cox.net>
- Date: Fri, 16 Jul 2010 06:59:52 -0400 (EDT)
data = Array[x, 10] {x(1),x(2),x(3),x(4),x(5),x(6),x(7),x(8),x(9),x(10)} example = {1, 5, 7, 9}; data[[example]] {x(1),x(5),x(7),x(9)} #[[example]] &[data] {x(1),x(5),x(7),x(9)} Bob Hanlon ---- Francisco Gutierrez <fgutiers2002 at yahoo.com> 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?