资源预览内容
第1页 / 共6页
第2页 / 共6页
第3页 / 共6页
第4页 / 共6页
第5页 / 共6页
第6页 / 共6页
亲,该文档总共6页全部预览完了,如果喜欢就下载吧!
资源描述
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((子图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阶梯图);subplot(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);plotyy(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; end endend由图片分析得: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;
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号