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