mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
1.5 KiB
1.5 KiB
| layout |
|---|
| default |
Function dotMultiply #
Multiply two matrices element wise. The function accepts both matrices and scalar values.
Syntax #
math.dotMultiply(x, y)
Parameters #
| Parameter | Type | Description |
|---|---|---|
x |
Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | Left hand value |
y |
Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | Right hand value |
Returns #
| Type | Description |
|---|---|
| Number | BigNumber | Complex | Unit | Array | Matrix | Multiplication of x and y |
Examples #
math.dotMultiply(2, 4); // returns 8
a = [[9, 5], [6, 1]];
b = [[3, 2], [5, 2]];
math.dotMultiply(a, b); // returns [[27, 10], [30, 2]]
math.multiply(a, b); // returns [[52, 28], [23, 14]]