Skip to main content
deleted 120 characters in body
Source Link
Niki Estner
  • 36.4k
  • 3
  • 92
  • 156

you can define a function that downsamples in one dimension:

downsampleX = Total /@ Partition[#, 10] &;

Then call that twice to downsample in both directions:

Transpose[downsampleX[Transpose[downsampleX[sbt]]]];

Takes about 0.19 sonce on my PC

More elegant, but slightly sloweryour array and then on each row:

downsampleX[downsampleXdownsampleX /@ sbt]downsampleX[sbt];

(Takes Takes about 0.2719 s) on my PC

you can define a function that downsamples in one dimension:

downsampleX = Total /@ Partition[#, 10] &;

Then call that twice to downsample in both directions:

Transpose[downsampleX[Transpose[downsampleX[sbt]]]];

Takes about 0.19 s on my PC

More elegant, but slightly slower:

downsampleX[downsampleX /@ sbt]

(Takes about 0.27 s)

you can define a function that downsamples in one dimension:

downsampleX = Total /@ Partition[#, 10] &;

Then call that once on your array and then on each row:

downsampleX /@ downsampleX[sbt];

Takes about 0.19 s on my PC

Source Link
Niki Estner
  • 36.4k
  • 3
  • 92
  • 156

you can define a function that downsamples in one dimension:

downsampleX = Total /@ Partition[#, 10] &;

Then call that twice to downsample in both directions:

Transpose[downsampleX[Transpose[downsampleX[sbt]]]];

Takes about 0.19 s on my PC

More elegant, but slightly slower:

downsampleX[downsampleX /@ sbt]

(Takes about 0.27 s)