14 lines
269 B
Matlab
14 lines
269 B
Matlab
% 练习2第五题
|
|
subplot(1,2,1)
|
|
t=0:0.1:2*pi;
|
|
x=sin(3*t).*cos(t);
|
|
y=sin(3*t).*sin(t);
|
|
plot(x,y,'-r','Linewidth',5);
|
|
subplot(1,2,2)
|
|
y1=sin(x);
|
|
y2=sin(x).*exp(-0.1*x);
|
|
plot(x,y1,'+b',x,y2,'-g')
|
|
title('曲线y1 y2')
|
|
xlabel('变量x')
|
|
ylabel('变量y')
|
|
legend('y1','y2'); |