sqrtm
Matrix square root function.
y=sqrtm(a)
Inputs
a A square matrix.
Outputs
y A square matrix of the same size as a which is the matrix square root of the input.


Example
>>a=[1 2 3 ; 4 5 6; 1.5 .5 1]
>>a
    1.0000    2.0000    3.0000
    4.0000    5.0000    6.0000
    1.5000    0.5000    1.0000

>>b=sqrtm(a)
>>b
    0.6826 +  0.7105i       0.6260 -  0.1960i       0.9836 -  0.4604i
    1.1329 +  0.0516i       2.0237 -  0.0142i       1.7291 -  0.0335i
    0.5711 -  0.5259i       0.1044 +  0.1451i       0.7817 +  0.3408i

>>b*b // Note that sqrtm(a)*sqrtm(a)=a in this case
    1.0000 +       0i       2.0000 +       0i       3.0000 +       0i
    4.0000 +       0i       5.0000 -       0i       6.0000 -       0i
    1.5000 -       0i       0.5000 -       0i       1.0000 -       0i