1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
%%
% 按照以下位置绘制图形
% 其中需要用到的数据如下,另外图片坐标的位置与示例图中大致相等即可
% % 图1
% x=linspace(0.2*pi,20);
% y=sin(x);
% % 图2
% t=0:pi/100:20*pi;
% x=sin(t);
% y=cos(t);
% z=t.*sin(t).*cos(t);
% % 图3
% [x,y]=meshgrid(-8:0.5:8);
% z=sin(sqrt(x.^2+y.^2))./sqrt(x.^2+y.^2+eps);
clear
figure
% 图1
x=linspace(0.2*pi,20);
y=sin(x);
axes('Position',[0.6,0.2,0.2,0.7],'GridLineStyle','-');
plot(y,x);
grid on
% 图2
axes('Position',[0.1,0.2,0.5,0.5]);
t=0:pi/100:20*pi;
x=sin(t);
y=cos(t);
z=t.*sin(t).*cos(t);
plot3(x,y,z);
% 图3
axes('Position',[0.1,0.6,0.25,0.3]);
[x,y]=meshgrid(-8:0.5:8);
z=sin(sqrt(x.^2+y.^2))./sqrt(x.^2+y.^2+eps);
mesh(x,y,z)
|