function m = msqrt(A) %matrix square root m such that m'*m = A [U,S,V]=svd(A); m = U*(S^.5)*V';