回 帖 发 新 帖 刷新版面

主题:[讨论]3D圖上, 在解答上畫出叉叉 (急! 需要協助!!)

以下的程序會畫出一個 3D 立體的圖像
z 是由 x 跟 y 所組成的 (有包涵虛數)
想要3D圖形上, 在所有 fz = 0 的地方, 用 marker 打一個叉叉做標記(老師要求)
可是我怎麼樣都弄不會



我弄了5個小時, 都失敗了   快哭出來了 T_T

真心需要大家的協助....

謝謝



functionphase_color
%This codeis modified from lab note 3-7


%set up meshgridof real and imaginary (x,y)
[x,y] =meshgrid(linspace(-2,2,100));
z = x + i*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


zlabel('Amplitude')
colorbar('vert')





%definethe function here
function out= fnc(z)
out =z.^3-2.*z.^2+z-1;

回复列表 (共1个回复)

沙发


function phase_color
%This codeis modified from lab note 3-7


%set up meshgridof real and imaginary (x,y)
[x,y] =meshgrid(linspace(-2,2,100));
z = x + i*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


zlabel('Amplitude')
colorbar('vert')





%definethe function here
function out= fnc(z)
out =z.^3-2.*z.^2+z-1;

我来回复

您尚未登录,请登录后再回复。点此登录或注册