1 |
|
2 |
|
3 | # Function sqrtm
|
4 |
|
5 | Calculate the principal square root of a square matrix.
|
6 | The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.
|
7 |
|
8 | https://en.wikipedia.org/wiki/Square_root_of_a_matrix
|
9 |
|
10 |
|
11 | ## Syntax
|
12 |
|
13 | ```js
|
14 | X = math.sqrtm(A)
|
15 | ```
|
16 |
|
17 | ### Parameters
|
18 |
|
19 | Parameter | Type | Description
|
20 | --------- | ---- | -----------
|
21 | `A` | Array | Matrix | The square matrix `A`
|
22 |
|
23 | ### Returns
|
24 |
|
25 | Type | Description
|
26 | ---- | -----------
|
27 | Array | Matrix | The principal square root of matrix `A`
|
28 |
|
29 |
|
30 | ## Examples
|
31 |
|
32 | ```js
|
33 | math.sqrtm([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]]
|
34 | ```
|
35 |
|
36 |
|
37 | ## See also
|
38 |
|
39 | [sqrt](sqrt.md),
|
40 | [pow](pow.md)
|