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