mirror of
https://github.com/josdejong/mathjs.git
synced 2025-12-08 19:46:04 +00:00
1.1 KiB
1.1 KiB
Function dotDivide
Divide two matrices element wise. The function accepts both matrices and scalar values.
Syntax
math.dotDivide(x, y)
Parameters
| Parameter | Type | Description |
|---|---|---|
x |
number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Numerator |
y |
number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Denominator |
Returns
| Type | Description |
|---|---|
| number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Quotient, x ./ y |
Examples
math.dotDivide(2, 4); // returns 0.5
a = [[9, 5], [6, 1]];
b = [[3, 2], [5, 2]];
math.dotDivide(a, b); // returns [[3, 2.5], [1.2, 0.5]]
math.divide(a, b); // returns [[1.75, 0.75], [-1.75, 2.25]]