I am working on a problem where the pressure profile is supposed to be smooth. For this the angle should be from 0 to 2pi. But when I take the logarithm of certain complex numbers, MATLAB maps the angle to the pi to negative pi range (clockwise direction).
For example :
var_z = [20.0 + 0.6i, 20.0 - 0.6i];
za2 = -2.5000 + 0.5000i;
A = log (-(var_z-za2))
yields A = [3.11 - 3.13i, 3.11 + 3.091i], but if the angle was only in the counterclockwise direction (i.e. [0, 2pi]) we'd get [3.11 + 3.14i, 3.11 + 3.09i] instead.
The latter result makes more sense in my situation as it prevents the pressure profiles from rapidly jumping up. Is there any way to force MATLAB to use 0 to 2pi for the radians?