Logarithm function that matches Matlab behaviour on negative entries (i.e. returns a complex number)
ISOpure.util.matlab_log(x)
Arguments
x: A numeric or complex value, vector, or matrix.
Returns
Returns log(x) if all entries of x > 0. For complex or negative input, x, where x = a + bi, the function returns log(z) = log(abs(z)) + 1i*atan2(b,a) where atan(b,a) is on the half-closed interval, (-pi, pi], as for the Matlab log function.