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 r1, r2, … in successive dimensions.
ArrayFilter[f,array,template]
applies f over blocks specified by the position of 1s in the array template.
Details 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:
-
None returns a smaller array val use val for padding "Fixed" repeat edge elements (default) "Periodic" periodic in each dimension
Examples
open allclose allBasic Examples (3)
Scope (4)
Specify length-3 blocks using a template:
Specify length-3 blocks using a template where the center element is not considered:
Specify length-3 blocks using a template where only the left element is considered:
Use DeleteMissing to remove elements according to a specified template:
Options (6)
Padding (6)
By default, fixed padding is used for neighborhoods at the border:
Pad neighborhoods using a constant value:
Periodic padding in all dimensions for a matrix:
With Padding->None, ArrayFilter only visits neighborhoods entirely inside the array:
Use padded values with different paddings:
With Padding->None, empty lists are returned when the neighborhood size is larger than the input:
Applications (5)
Text
Wolfram Research (2015), ArrayFilter, Wolfram Language function, https://reference.wolfram.com/language/ref/ArrayFilter.html.
CMS
Wolfram Language. 2015. "ArrayFilter." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ArrayFilter.html.
APA
Wolfram Language. (2015). ArrayFilter. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArrayFilter.html