Skip to main content
1 of 3
novice
  • 2.3k
  • 1
  • 25
  • 30

Take sublist with fixed interval

For example:

a = Range[20];

enter image description here

I want to take elements from a with interval = 2 :

enter image description here

Take[a, {1, -1, 2}] fails to do this.

It would be better if it works for 3d or higher dimensional large matrix.

novice
  • 2.3k
  • 1
  • 25
  • 30