📄 a9.m
字号:
[x,y]=meshgrid(-8:0.8:8);
z=peaks(x,y);
[xi,yi]=meshgrid(-8:0.3:8);
zi1=interp2(x,y,z,xi,yi,'linear')
subplot(221)
mesh(x,y,z)
hold on
mesh(xi,yi,zi1+15);
hold off
axis tight
title('linear')
zi2=interp2(x,y,z,xi,yi,'nearest')
subplot(222)
mesh(x,y,z)
hold on
mesh(xi,yi,zi2+15);
hold off
axis tight
title('nearest')
zi3=interp2(x,y,z,xi,yi,'spline')
subplot(223)
mesh(x,y,z)
hold on
mesh(xi,yi,zi3+15);
hold off
axis tight
title('spline')
zi4=interp2(x,y,z,xi,yi,'cubic')
subplot(224)
mesh(x,y,z)
hold on
mesh(xi,yi,zi4+15);
hold off
axis tight
title('cubic')
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -