📄 example_surf.m
字号:
% example_surf.m
% surf函数绘制表面图
[x,y,z]=peaks(30);
% 图1:一般的surf函数绘制
subplot(2,2,1);
surf(x,y,z);
title('figure1: surf of peaks');
% 图2:平面阴影
subplot(2,2,2);
surf(x,y,z);
shading flat;
title('figure2: surf with shading flat');
% 图3:插值阴影
subplot(2,2,3);
surf(x,y,z);
shading interp;
title('figure3: surf with shading interp');
% 图4:遮挡绘制
x1=x(1,:);
y1=y(:,1);
i=find(y1>.8 & y1<1.2);
j=find(x1>-.6 & x1<.5);
z(i,j)=NaN;
subplot(2,2,4);
surf(x,y,z);
title('figure4: surf with hole');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -