matlab 实验6 高层绘图操作,实验六 高层绘图操作答案

41528d3028836879cd698677c3999917.gif实验六 高层绘图操作答案

实验六 高层绘图操作 实验目的: 1. 掌握绘制二维图形的常用函数 2. 掌握绘制三维图形的常用函数 3. 掌握绘制图形的辅助操作 实验内容: 1. 1. 设,在区间取101点,绘制函数曲线。 x=0:pi/100:2*pi; y=(0.5+3*sin(x)./(1+x^2)).*cos(x); plot(x,y); 2. 已知,,,完成下列操作: (1) 在同一坐标系下用不同的颜色和线型绘制三条曲线。 (2) 以子图形式绘制三条曲线。 (3) 分别用条形图、阶梯图、杆图和填充图绘制三条曲线。 (1).在同一坐标系下用不同的颜色和线型绘制三条曲线。 x=0:pi/1000:2*pi; y1=x.^2; y2=cos(2*x); y3=y1.*y2; plot(x,y1, r ,x,y2, b-. ,x,y3, k-- ); (2). 以子图形式绘制三条曲线。 x=0:pi/10:2*pi; y1=x.^2; subplot(2,2,1);plot(x,y1, r ); title( y1=x^2 ); y2=cos(2*x); subplot(2,2,2);plot(x,y2, b-. ); title( y2=cos(2*x) ); y3=y1.*y2; subplot(2,2,3);plot(x,y3, k-- ); title( y3=y1.*y2 ); (3). 分别用条形图、阶梯图、杆图和填充图绘制三条曲线。 x=0:pi/10:2*pi; y1=x.^2; subplot(2,2,1);bar(x,y1, r ); title( y1=x^2 ); subplot(2,2,2);stairs(x,y1, r ); title( y1=x^2 ); subplot(2,2,3);stem(x,y1, r ); title( y1=x^2 ); subplot(2,2,4);fill(x,y1, r ); title( y1=x^2 ); x=0:pi/10:2*pi; y2=cos(2*x); subplot(2,2,1);bar(x,y2, b ); title( y2=cos(2*x) ); subplot(2,2,2);stairs(x,y2, b ); title( y2=cos(2*x) ); subplot(2,2,3);stem(x,y2, b ); title( y2=cos(2*x) ); subplot(2,2,4);fill(x,y2, b ); title( y2=cos(2*x) ); x=0:pi/10:2*pi; y3=y1.*y2; subplot(2,2,1);bar(x,y3, m ); title( y3=y1.*y2 ); subplot(2,2,2);stairs(x,y3, m ); title( y3=y1.*y2 ); subplot(2,2,3);stem(x,y3, m ); title( y3=y1.*y2 ); subplot(2,2,4);fill(x,y3, m ); title( y3=y1.*y2 ); 3. 已知 在绘制函数曲线。 x1=-5:0.01:0; x2=0.01:0.01:5; y1=(x1+sqrt(pi))./exp(2); y2=log(x2+sqrt(1+x2.^2))./2; plot(x1,y1, b ,x2,y2, b ); 4. 绘制极坐标曲线,并分析参数、、对曲线形状的影响。 a=( a: ); b=( b: ); n=( n: ); theta=0:0.01:2*pi; rho=a*sin(b+n*theta); polar(theta,rho); 5. 绘制函数的曲面图和等高线。 其中的21个值均匀分布在[-5,5]范围,的31个值均匀分布在[0,10],要求使用subplot(2,1,1)和supplot(2,1,2)将产生的曲面图和等高线图画在同一个窗口上。 x=linspace(-5,5,21); y=linspace(0,10,31); [X,Y]=meshgrid(x,y); Z=cos(X).*cos(Y).*exp(-sqrt(X.^2+Y.^2)/4); subplot(2,1,1);surf(X,Y,Z); subplot(2,1,2);contour(X,Y,Z,12); 6. 绘制曲面图形,并进行插值着色处理。 s=0:pi/50:pi/2; t=0:pi/50:3/2*pi; [s,t]=meshgrid(s,t); x=cos(s).*cos(t); y=cos(s).*sin(t); z=sin(s); surf(x,y,z); shading interp;

  • 0
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值