[問題] 用記號標出0的位置已回收
老師提供了一個現有 已經寫好得 m -file, 要同學加進一些 code
code必須用叉叉(x) 標出解為 0 的地方 ( fz = 0 時)
很急很急, 必須在半天內就交出 Q_Q
以下為已經寫好得code (會產生一個由實數與虛數組成的 3D 立體圖)
需要加進標叉叉的code
謝謝
function phase_color
%set up meshgrid of real and imaginary (x,y)
[x,y] = meshgrid(linspace(-2,2,100));
z = x + i*y; %設Ζ由x跟y組成
fz = fnc(z);
phase = unwrap(angle(fz),[],2);
caxis([min(min(phase)) max(max(phase))]); %scale colormap according to phase
surf(x,y,abs(fz),phase) %display absolute value(magnitude) of function
shading interp
%以上都是畫 3D圖,大家看不明白不用擔心,可以掠過
zlabel('Amplitude')
colorbar('vert')
%define the function here
function out = fnc(z)
out = z.^3-2.*z.^2+z-1;
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 128.151.87.122
12/13 06:48
※ 編輯: cosomyr 來自: 128.151.87.122 (12/13 06:53)
※ 編輯: cosomyr 來自: 128.151.180.239 (12/13 13:07)
MATLAB 近期熱門文章
PTT數位生活區 即時熱門文章