| Author |
Comment/Response |
Ben Kovitz
|
11/21/04 12:56pm
Is there an easy, elegant way to extract all the elements of a list with an odd index?
I came up with this:
oddElements = Table[data[[i]], {i, 1, Length[data], 2}]
which works, but it seems like there ought to be a way that uses OddQ on the index, something like this:
oddElements = Select[data, OddQ[somehow get the index of the element]& ]
Is there a way?
Ben Kovitz
URL: , |
|