Wilang Documentation1.0.0+4

mapSlices#

Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.

Available in: math cells, REPL.

Syntax#

mapSlices(A, dim, callback)

Arguments and behavior#

Dimension is one-based. Pass a supported callback such as sum. The app prod function is symbolic and cannot reduce a numeric slice.

Example#

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

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

Expected result: matrix.

See also#

map · forEach

All functions · Math guides