UNPKG

956 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function prod
4
5Compute the product of a matrix or a list with values.
6In case of a (multi dimensional) array or matrix, the sum of all
7elements will be calculated.
8
9
10## Syntax
11
12```js
13math.prod(a, b, c, ...)
14math.prod(A)
15```
16
17### Parameters
18
19Parameter | Type | Description
20--------- | ---- | -----------
21`args` | ... * | A single matrix or or multiple scalar values
22
23### Returns
24
25Type | Description
26---- | -----------
27* | The product of all values
28
29
30## Examples
31
32```js
33math.multiply(2, 3) // returns 6
34math.prod(2, 3) // returns 6
35math.prod(2, 3, 4) // returns 24
36math.prod([2, 3, 4]) // returns 24
37math.prod([[2, 5], [4, 3]]) // returns 120
38```
39
40
41## See also
42
43[mean](mean.md),
44[median](median.md),
45[min](min.md),
46[max](max.md),
47[sum](sum.md),
48[std](std.md),
49[variance](variance.md)