Wilang Documentation1.0.0+4

apply#

Reduce slices of a matrix using a callback.

Available in: math cells, REPL.

Syntax#

apply(A, dimension, callback)

Arguments and behavior#

Dimension is one-based in a cell. Use a function name as callback. mapSlices is the clearer modern spelling.

Example#

Edit the inputs, then use Run or Reset. Changes stay in this example.

Example
apply([[1,2],[3,4]],1,sum)

Expected result: matrix.

See also#

mapSlices

All functions · Math guides