MATLAB程序设计与应用(第三版)刘卫国 答案(五)

第五章 MATLAB绘图

一、选择题
1~5:DAAAC
6~10:BDCAB
填空题
1.plot(x,y);title(‘正弦波’);xlabel(‘时间’);ylabel(‘幅度’)。
2.hold on;axis([-3 3 -5 20])。
3.圆。
4.饼图;pie([450.6 395.5 410.2 450.9]);
三、应用题
1
(1)

  x=-2:0.05:2;
    y=100/1+x.^2;
    plot(x,y)

在这里插入图片描述

(2)

x=-2:0.05:2;
y=(1/2*pi)*exp(-x.^2/2);
plot(x,y)

在这里插入图片描述
(3)

ezplot(@(x,y )x.^2+y.^2-1)

在这里插入图片描述
(4)

t=-5:0.05:5;
x=t.^2;
y=5*t.^3;
plot(x,y)

在这里插入图片描述
2.

x=-2*pi:pi/100:2*pi;
y=sin(1./x);
subplot(1,2,1)
plot(x,y)
title('plot函数绘制')
subplot(1,2,2)
fplot(@(x) sin(1./x))
title('fplot函数绘制')


3.

t=-2*pi:pi/100:2*pi;%第(1)题
r1=5*cos(t)+4;
subplot(2,2,1)
polar(t,r1)
title('(1)');
r2=12./sqrt(t);第(2)题
subplot(2,2,2);
polar(t,r2)
title('(2)');
r3=(5./cos(t))-7;第(3)题
subplot(2,2,3)
polar(t,r3);
title('(3)');
r4=(pi/3)*t.^2;第(4)题
subplot(2,2,4)
polar(t,r4);
title('(4)')

在这里插入图片描述

x1=-2:0.04:2;
t=0:pi/100:pi;
y1=2*x1-0.5;
x2=sin(3*t).*cos(t);
y2=sin(3*t).*sin(t);
plot(x1,y1,x2,y2,x3,y3,'rp')
k=find(abs(y2-y1)<0.001);
x3=x1(k);
y3=2*x3-0.5;
plot(x1,y1,x2,y2,x3,y3,'rp')

在这里插入图片描述
5.

t=-2*pi:pi/100:2*pi;%第(1)题
x1=cos(t);
y1=sin(t);
z1=t;
subplot(2,2,1)
plot3(x1,y1,z1)
title('(1)');
u=t;v=t;%第(2)题
x2=(1+cos(u).*cos(v));
y2=(1+cos(u).*sin(v));
z2=sin(u);
subplot(2,2,2)
plot3(x2,y2,z2);
title('(2)');
[x3,y3]=meshgrid(-10:10);%第(3)题
z3=5*ones(size(x3));
subplot(2,2,3)
surf(x3,y3,z3)
title('(3)');
[x4,y4,z4]=sphere(20);%第(4)题
x4=10*x4;y4=10*y4;z4=10*z4;
subplot(2,2,4)
surf(x4,y4,z4)
title('(4)')

在这里插入图片描述
若想要讲解可下方留言,看到就会回复!!!

  • 39
    点赞
  • 231
    收藏
    觉得还不错? 一键收藏
  • 13
    评论
评论 13
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值