mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
57 lines
1.6 KiB
Markdown
57 lines
1.6 KiB
Markdown
---
|
|
layout: default
|
|
---
|
|
|
|
<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
|
|
|
|
<h1 id="function-dotdivide">Function dotDivide <a href="#function-dotdivide" title="Permalink">#</a></h1>
|
|
|
|
Divide two matrices element wise. The function accepts both matrices and
|
|
scalar values.
|
|
|
|
|
|
<h2 id="syntax">Syntax <a href="#syntax" title="Permalink">#</a></h2>
|
|
|
|
```js
|
|
math.dotDivide(x, y)
|
|
```
|
|
|
|
<h3 id="parameters">Parameters <a href="#parameters" title="Permalink">#</a></h3>
|
|
|
|
Parameter | Type | Description
|
|
--------- | ---- | -----------
|
|
`x` | number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Numerator
|
|
`y` | number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Denominator
|
|
|
|
<h3 id="returns">Returns <a href="#returns" title="Permalink">#</a></h3>
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
number | BigNumber | Fraction | Complex | Unit | Array | Matrix | Quotient, `x ./ y`
|
|
|
|
|
|
<h3 id="throws">Throws <a href="#throws" title="Permalink">#</a></h3>
|
|
|
|
Type | Description
|
|
---- | -----------
|
|
|
|
|
|
<h2 id="examples">Examples <a href="#examples" title="Permalink">#</a></h2>
|
|
|
|
```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]]
|
|
```
|
|
|
|
|
|
<h2 id="see-also">See also <a href="#see-also" title="Permalink">#</a></h2>
|
|
|
|
[divide](divide.html),
|
|
[multiply](multiply.html),
|
|
[dotMultiply](dotMultiply.html)
|