function x = reallog(x) %REALLOG log(x) which raises an error if complex numbers result. % % This is for older versions of Octave, which didn't ship with this function. x = log(x); if any(imag(x(:))) error('reallog caught a complex result'); end