mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
48 lines
1.1 KiB
Markdown
48 lines
1.1 KiB
Markdown
# Function dotDivide
|
|
|
|
Divide two matrices element wise. The function accepts both matrices and
|
|
scalar values.
|
|
|
|
|
|
## Syntax
|
|
|
|
```js
|
|
math.dotDivide(x, y)
|
|
```
|
|
|
|
### Parameters
|
|
|
|
Parameter | Type | Description
|
|
--------- | ---- | -----------
|
|
`x` | Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | null | Numerator
|
|
`y` | Number | BigNumber | Boolean | Complex | Unit | Array | Matrix | null | Denominator
|
|
|
|
### Returns
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
Number | BigNumber | Complex | Unit | Array | Matrix | Quotient, `x ./ y`
|
|
|
|
|
|
## Examples
|
|
|
|
```js
|
|
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]]
|
|
```
|
|
|
|
|
|
## See also
|
|
|
|
[divide](divide.md),
|
|
[multiply](multiply.md),
|
|
[dotMultiply](dotMultiply.md)
|
|
|
|
|
|
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|