56 lines
1008 B
Markdown
56 lines
1008 B
Markdown
|
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
||
|
|
||
|
# Function prod
|
||
|
|
||
|
Compute the product of a matrix or a list with values.
|
||
|
In case of a (multi dimensional) array or matrix, the sum of all
|
||
|
elements will be calculated.
|
||
|
|
||
|
|
||
|
## Syntax
|
||
|
|
||
|
```js
|
||
|
math.prod(a, b, c, ...)
|
||
|
math.prod(A)
|
||
|
```
|
||
|
|
||
|
### Parameters
|
||
|
|
||
|
Parameter | Type | Description
|
||
|
--------- | ---- | -----------
|
||
|
`args` | ... * | A single matrix or or multiple scalar values
|
||
|
|
||
|
### Returns
|
||
|
|
||
|
Type | Description
|
||
|
---- | -----------
|
||
|
* | The product of all values
|
||
|
|
||
|
|
||
|
### Throws
|
||
|
|
||
|
Type | Description
|
||
|
---- | -----------
|
||
|
|
||
|
|
||
|
## Examples
|
||
|
|
||
|
```js
|
||
|
math.multiply(2, 3) // returns 6
|
||
|
math.prod(2, 3) // returns 6
|
||
|
math.prod(2, 3, 4) // returns 24
|
||
|
math.prod([2, 3, 4]) // returns 24
|
||
|
math.prod([[2, 5], [4, 3]]) // returns 120
|
||
|
```
|
||
|
|
||
|
|
||
|
## See also
|
||
|
|
||
|
[mean](mean.md),
|
||
|
[median](median.md),
|
||
|
[min](min.md),
|
||
|
[max](max.md),
|
||
|
[sum](sum.md),
|
||
|
[std](std.md),
|
||
|
[variance](variance.md)
|