function z=logcomplex(m,n) a=sym(m); b=sym(n); x=log(a*a+b*b)/2; y=sym('pi')+atan(b/a); z=x+y*i;