If H = [4 4; 4 4]
Why is sqrt(H)=[2 2; 2 2]
And, (H)^0.5=[1.4142 1.4142; 1.4142 1.4142]
If H = [4 4; 4 4]
Why is sqrt(H)=[2 2; 2 2]
And, (H)^0.5=[1.4142 1.4142; 1.4142 1.4142]
On
Looking at the MATLAB documentation of the sqrt() function, we see (emphasis mine):
B = sqrt(X)returns the square root of each element of the arrayX.
So since $\sqrt 4 = 2$, that's what you get.
Reading further on that page, we find
See
sqrtmfor the matrix square root.
which is probably the one you actually expected.
In the first case, it's taking the square root of each element. In the second case, it's determining the matrix that, when multiplied by itself, gives $H$, i.e., the "square root" of $H$.