UNPKG

1.08 kBMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function dotMultiply
4
5Multiply two matrices element wise. The function accepts both matrices and
6scalar values.
7
8
9## Syntax
10
11```js
12math.dotMultiply(x, y)
13```
14
15### Parameters
16
17Parameter | Type | Description
18--------- | ---- | -----------
19`x` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Left hand value
20`y` | number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Right hand value
21
22### Returns
23
24Type | Description
25---- | -----------
26number &#124; BigNumber &#124; Fraction &#124; Complex &#124; Unit &#124; Array &#124; Matrix | Multiplication of `x` and `y`
27
28
29## Examples
30
31```js
32math.dotMultiply(2, 4) // returns 8
33
34a = [[9, 5], [6, 1]]
35b = [[3, 2], [5, 2]]
36
37math.dotMultiply(a, b) // returns [[27, 10], [30, 2]]
38math.multiply(a, b) // returns [[52, 28], [23, 14]]
39```
40
41
42## See also
43
44[multiply](multiply.md),
45[divide](divide.md),
46[dotDivide](dotDivide.md)