a9.m
来自「the file contain many matlab signal sour」· M 代码 · 共 36 行
M
36 行
[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 + =
减小字号Ctrl + -
显示快捷键?