function W = NT(X,Y) %Generate the symmetric positive definite matrix W from two symmetric %positive definite matrices X, Y such that WYW = X. Xhalf=X^(1/2); W=Xhalf*(Xhalf*Y*Xhalf)^(-1/2)*Xhalf;