www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/ComplexValuedCommonLogarithmExample.m
%% Complex-Valued Common Logarithm % % Copyright 2015 The MathWorks, Inc. %% % Create two Cartesian grids for |X| and |Y|. [X,Y] = meshgrid(0:0.5:1.5,-2:0.5:2); %% % Calculate the complex base 10 logarithm $log_{10}(X + iY)$ on the grid. % Use |1i| for improved speed and robustness with complex arithmetic. Z = log10(X + 1i*Y)