mathjs
Version:
Math.js is an extensive math library for JavaScript and Node.js. It features a flexible expression parser with support for symbolic computation, comes with a large set of built-in functions and constants, and offers an integrated solution to work with dif
11 lines • 406 B
JavaScript
export var mapSlicesDocs = {
name: 'mapSlices',
category: 'Matrix',
syntax: ['mapSlices(A, dim, callback)'],
description: 'Generate a matrix one dimension less than A by applying callback to ' + 'each slice of A along dimension dim.',
examples: ['A = [[1, 2], [3, 4]]', 'mapSlices(A, 1, sum)',
// returns [4, 6]
'mapSlices(A, 2, prod)' // returns [2, 12]
],
seealso: ['map', 'forEach']
};