Description Arguments Value Usage Details Author(s) See Also Examples
Apply a function to non-overlapping sub-sequences and the accumulated value of the function application
x |
Any indexable data structure |
window |
The number of elements in each sub-sequence |
fn |
The function applied to the sub-sequence |
acc |
The intermediate accumulated value |
The accumulated value
foldblock(x, window, fn, acc=0)
This function is the fold counterpart of mapblock. Like mapblock the usefulness of this function is for the 2D case, as it can simplify interacting with matrices. See the example below for using foldblock as a summation operator over matrices
Brian Lee Yung Rowe
1 2 3 4 5 6 7 8 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.