1、1 题x=linspace(0,2*pi,101);y=(0.5+(3*sin(x)/(1+x.2)*cos(x);plot(x,y)2 题x=linspace(0,2*pi,100);y1=x.2;y2=cos(2*x);y3=y1.*y2;subplot(2,2,1);plot(x,y1,g,x,y2,r,x,y3,c)title(第 (1)小题不同颜色绘图)subplot(2,2,2);plot(x,y1);title(第(2)小题( 子图 1))subplot(2,2,3);plot(x,y2);title((子图 2))subplot(2,2,4);plot(x,y3);title(
2、(子图 3))figure(2)subplot(4,4,1);bar(x,y1);title(y1 条形图);subplot(3,4,2);stem(x,y1);title(y1 杆图);subplot(3,4,3);stairs(x,y1);title(y1 阶梯图);subplot(3,4,4);fill(x,y1,g);title(y1 填充图);subplot(3,4,5);bar(x,y2);title(y2 条形图);subplot(3,4,6);stem(x,y2);title(y2 杆图);subplot(3,4,7);stairs(x,y2);title(y2 阶梯图);su
3、bplot(3,4,8);fill(x,y2,g);title(y2 填充图);subplot(3,4,9);bar(x,y3);title(y3 条形图);subplot(3,4,10);stem(x,y3);title(y3 杆图);subplot(3,4,11);stairs(x,y3);title(y3 阶梯图);subplot(3,4,12);fill(x,y3,g);title(y3 填充图);3 题x1=linspace(-5,0,50);x2=linspace(0,5,50);y1=(x1+sqrt(pi)/exp(2);y2=1/2*log(x2+sqrt(1+x2.2);p
4、lotyy(x1,y1,x2,y2)grid on4 题theta=0:0.01:2*pi;c=1;for(a=4:5)for(b=2:3)for(n=3:4)rho=a*sin(b+n*theta);subplot(2,4,c)polar(theta,rho,g)c=c+1;endendend由图片分析得:a 影响曲线的半径,b 影响曲线的角度,n 影响曲线的周期5 题x=linspace(-5,5,31);y=linspace(0,10,21);x,y=meshgrid(x,y)a=sqrt(x.2+y.2);z=cos(x).*cos(y).*exp(-a/4);subplot(1,2,1);surf(x,y,z);shading interpview(-27.5,30)subplot(1,2,2);contour3(x,y,z,50,g)6 题s=linspace(0,pi/2,100);t=linspace(0,pi*3/2,100);s,t=meshgrid(s,t)x=cos(s).*cos(t);y=cos(s).*sin(t);z=sin(s);surf(x,y,z)shading interp;