MathGroup Archive 2005

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

Search the Archive

Re: Tilting at Windmills?

  • To: mathgroup at
  • Subject: [mg62130] Re: Tilting at Windmills?
  • From: lucb at
  • Date: Sat, 12 Nov 2005 03:31:43 -0500 (EST)
  • Sender: owner-wri-mathgroup at

Matt, would this do what you want in a simpler way?

test = Range[5]

the list is first duplicated to have 4 lists using Table. Then the elements are re-arranged using Transpose and flatten.
Then we remove the first 3 and the last 3 and finally Partition it like you wnat.

Partition[Drop[Drop[Flatten[Transpose[Table[test, {4}]]], 3], -3], 2]

on this server it seems to go fast

Timing[result = Partition[Drop[Drop[Flatten[Transpose[Table[ Range[200000], {4}]]], 3], -3], 2];]

I hope this helps,


P.S: and Phil was faster than me at answering this...

Link to the forum page for this post:
Posted through [[postId=5930]]

  • Prev by Date: Re: Re: 'Good' or 'Proper' Mathematica coding habits question
  • Next by Date: Re: Integrate problem?
  • Previous by thread: Re: Tilting at Windmills?
  • Next by thread: Re: Tilting at Windmills?