sqrtm.md (810B)
1 <!-- Note: This file is automatically generated from source code comments. Changes made in this file will be overridden. --> 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 ### Throws 31 32 Type | Description 33 ---- | ----------- 34 35 36 ## Examples 37 38 ```js 39 math.sqrtm([[1, 2], [3, 4]]) // returns [[-2, 1], [1.5, -0.5]] 40 ``` 41 42 43 ## See also 44 45 [sqrt](sqrt.md), 46 [pow](pow.md)