Wolfram Language & System 10.4 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

ArrayFilter

ArrayFilter[f,array,r]
applies f to all range-r blocks in the specified array.

ArrayFilter[f,array,{r1,r2,}]
applies f to blocks with ranges , , in successive dimensions.

ArrayFilter[f,array,template]
applies f over blocks specified by the position of 1s in the array template.

Details and OptionsDetails and Options

  • ArrayFilter[f,array,] requires that array is full array to a certain depth.
  • ArrayFilter[f,array,r] applies f to all overlapping blocks of elements in array.
  • Both array and template can be SparseArray objects.
  • With ArrayFilter[f,array,template], neighborhood elements corresponding to 0s of template are replaced with Missing[] before being passed to f.
  • ArrayFilter has the option Padding, which specifies how neighborhoods should be formed at the edges of the array. The following settings can be used:
  • Nonereturns a smaller array
    valuse val for padding
    "Fixed"repeat edge elements (default)
    "Periodic"periodic in each dimension

ExamplesExamplesopen allclose all

Basic Examples  (3)Basic Examples  (3)

Apply f to each element of a list and its range-1 neighbors:

In[1]:=
Click for copyable input
Out[1]=

Apply f to each element of a list and its range-2 neighbors:

In[1]:=
Click for copyable input
Out[1]=

Apply f to all 3x3 blocks of range-1 neighbors around each element:

In[1]:=
Click for copyable input
Out[1]=

Show as matrices:

In[2]:=
Click for copyable input
Out[2]//TraditionalForm=
Introduced in 2015
(10.2)