Why is the sqrt of a matrix different to ^0.5

380 Views Asked by At

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]

2

There are 2 best solutions below

0
On BEST ANSWER

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$.

0
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 array X.

So since $\sqrt 4 = 2$, that's what you get.

Reading further on that page, we find

See sqrtm for the matrix square root.

which is probably the one you actually expected.