⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex4_24.m

📁 源代码集合
💻 M
字号:
[x,y] = meshgrid(-3:0.1:3,-2:0.1:2);
z=(x.^2-2*x).*exp(-x.^2-y.^2-x.*y);

for i=1:2, for j=1:2
   eval(['subplot(22' int2str((i-1)*2+j) ')'])
   mesh(x,y,z); axis([-3,3,-2,2,-0.7,1.5])
end, end
subplot(221), surf(x,y,z); shading flat; axis([-3,3,-2,2,-0.7,1.5])
view(0,90), title('view(0,90)')
subplot(222), view(90,0), title('view(90,0)')
subplot(223), view(0,0), title('view(0,0)')
subplot(224),  title('normal viewpoint')

for i=1:2, for j=1:2
   eval(['subplot(22' int2str((i-1)*2+j) ')'])
   surf(x,y,z); shading interp, axis([-3,3,-2,2,-0.7,1.5]), 
end, end
subplot(221), view(0,90), title('view(0,90)')
subplot(222), view(90,0), title('view(90,0)')
subplot(223), view(0,0), title('view(0,0)')
subplot(224),  title('normal viewpoint')

subplot(221), contour(x,y,z,30)
subplot(222), y1=-2:0.1:2; plot(y1,z'); axis([-3 3 -0.7,1.5])
subplot(223), x1=-3:0.1:3; plot(x1,z); axis([-2 2 -0.7,1.5])
subplot(224), mesh(x,y,z); axis([-3 3 -2 2 -0.7 1.5])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -