Skip to main content
deleted 46 characters in body
Source Link

For example:

a = Range[20];
a = ArrayReshape[a, {4, 5}]

enter image description herematrix a

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

enter image description heresublist of a

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

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

For example:

a = Range[20];
a = ArrayReshape[a, {4, 5}]

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.

For example:

a = Range[20];
a = ArrayReshape[a, {4, 5}]

matrix a

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

sublist of a

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

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

added 33 characters in body
Source Link
novice
  • 2.3k
  • 1
  • 25
  • 30

For example:

a = Range[20];
a = ArrayReshape[a, {4, 5}]

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.

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.

For example:

a = Range[20];
a = ArrayReshape[a, {4, 5}]

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.

Source Link
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.