UNPKG

731 BMarkdownView Raw
1<!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. -->
2
3# Function inv
4
5Calculate the inverse of a square matrix.
6
7
8## Syntax
9
10```js
11math.inv(x)
12```
13
14### Parameters
15
16Parameter | Type | Description
17--------- | ---- | -----------
18`x` | number &#124; Complex &#124; Array &#124; Matrix | Matrix to be inversed
19
20### Returns
21
22Type | Description
23---- | -----------
24number &#124; Complex &#124; Array &#124; Matrix | The inverse of `x`.
25
26
27## Examples
28
29```js
30math.inv([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]
31math.inv(4) // returns 0.25
321 / 4 // returns 0.25
33```
34
35
36## See also
37
38[det](det.md),
39[transpose](transpose.md)