x=0:2*pi/124:2*pi;
y=cos(x).*(0.5+3*sin(x)./(1+x.^2));
plot(x,y)
z=-45:0.01:45;
x=z.*sin(3*z);
y=z.*cos(3*z);
plot3(x,y,z)
x=-2:0.1:2;
y=-2:0.1:2;
[X,Y]=meshgrid(x,y);
Z=(X.^2).*exp(-X.^2-Y.^2);
mesh(X,Y,Z)
x=-2:0.1:2;
y=-2:0.1:2;
[X,Y]=meshgrid(x,y);
Z=(X.^2).*exp(-X.^2-Y.^2);
mesh(X,Y,Z)
hold on;
Z1=0.05*X-0.05*Y+0.1;
mesh(X,Y,Z1)
hold off;
t=0:pi/1000:2*pi;
x=cos(t);
y1=sin(2*t);
y2=sin(2*t+pi/3);
y3=sin(2*t+pi/2);
y4=sin(2*t+pi);
subplot(2,2,1), plot(x, y1);title('α=0')
subplot(2,2,2), plot(x, y2);title('α=Π/3')
subplot(2,2,3), plot(x, y3);title('α=Π/2')
subplot(2,2,4), plot(x, y4);title('α=Π')
2.请用Matlab绘制一个爱心图案,并简单描述绘制过程。
x=-2:0.01:2;
y=sqrt(2*sqrt(x.^2)-x.^2);
z=asin(abs(x)-1)-pi./2;
plot(x,y,'r');
hold on;
plot(x,z,'r');
axis([-2,2,-3.5,1.5]);