MATLAB: Applying log to matrix converts from real to complex: why

complexlogMATLABreal

Hello everyone,
I'm experiencing a very strange behaviour from matlab: I have a 132×4 matrix of real numbers and I need to take their logs. Of course, if I take each number's log individually, it works fine. If I instead use the function log on the whole matrix transf = log(matrix); numbers are converted to their logs from row 1 to 64, but from row 65 to the end they are converted to complex numbers (NaNs as well).
What can this be caused by?
Thanks in advance

Best Answer

maybe you have negativ numbers
log(-1.5)
it's a complex logarithm