我有以下 Matlab 代碼,我想將其轉(zhuǎn)換為 Python 3 代碼。r = (0:1:15)'; % create a matrix of complex inputstheta = pi*(-2:0.05:2);z = r*exp(1i*theta);%w = z.^(1/2) ; % calculate the complex outputsw = sqrt(r)*exp(1i*theta/2);figure('Name','Graphique complexe','units','normalized','outerposition',[ 0.08 0.1 0.8 0.55]);subplot(121)surf(real(z),imag(z),real(w),imag(w)) % visualize the complex function using surfxlabel('Real(z)')ylabel('Imag(z)')zlabel('Real(u)')cb = colorbar;colormap jet; % gradient from blue to redcb.Label.String = 'Imag(v)';subplot(122)surf(real(z),imag(z),imag(w),real(w)) % visualize the complex function using surfxlabel('Real(z)')ylabel('Imag(z)')zlabel('Imag(v)')cb = colorbar;colormap jet; % gradient from blue to redcb.Label.String = 'Real(u)';可以在此處找到結(jié)果和原始討論。此SO 頁(yè)面上還有可用的討論。但是,我未能運(yùn)行和重現(xiàn)這些代碼。接下來(lái)我可以嘗試什么?
添加回答
舉報(bào)
0/150
提交
取消