Matlab大作业.doc

上传人:罗晋 文档编号:8846581 上传时间:2021-01-19 格式:DOC 页数:11 大小:243KB
返回 下载 相关 举报
Matlab大作业.doc_第1页
第1页 / 共11页
Matlab大作业.doc_第2页
第2页 / 共11页
Matlab大作业.doc_第3页
第3页 / 共11页
Matlab大作业.doc_第4页
第4页 / 共11页
Matlab大作业.doc_第5页
第5页 / 共11页
点击查看更多>>
资源描述

《Matlab大作业.doc》由会员分享,可在线阅读,更多相关《Matlab大作业.doc(11页珍藏版)》请在三一文库上搜索。

1、通信电路仿真大作业 系别:电子通信工程系班级:通信技术092 姓名:任凯博学号:090413236第一章4、 help gcd GCD Greatest common divisor. G = GCD(A,B) is the greatest common divisor of corresponding elements of A and B. The arrays A and B must contain non-negative integers and must be the same size (or either can be scalar). GCD(0,0) is 0 by c

2、onvention; all other GCDs are positive integers. G,C,D = GCD(A,B) also returns C and D so that G = A.*C + B.*D. These are useful for solving Diophantine equations and computing Hermite transformations. See also LCM. c=gcd(15,35)c = 55、clearclca=4.96b=8.11s=exp(a-b)/log(a+b)运行结果:a = 4.9600b = 8.1100s

3、 =0.0167第二章3、clearclcscore=input(请输入学生成绩score=:);if score=60 score=及格else score=不及格end 运行结果:请输入学生成绩score=:70 score = 及格5、clearclcx=input(输入x的值x=)if x5&x10 y=2*x;endy结果如下:输入x的值x=12x =12y =24第三章2、 clearclcx=0:pi/100:pi;y1=x;y2=x.2;y3=-x.2;y4=x.*sin(x);plot(x,y1,:,x,y2,-,x,y3,-,x,y4,-.)运行结果如下图所示:4、解:(1

4、)程序如下:clearclct=0:pi/50:2*pi;a=(cos(t).3)-1;polar(t,a)结果如图:(2)程序如下:clearclct=0:pi/50:pi*2;b=cos(t).*sin(t);polar(t,b)结果如图:9、clearclcx=0:0.2:2y1=2*exp(-0,5*x)y2=sin(2*pi*x)plot(x,y1,b-,x,y2,k-);运行结果如下图所示:第四章1、对表达式f=(1/x3+4/x2+6/x+8)(1/3) 进行化简。运行结果如下: syms x f=(1/x3+4/x2+6/x+8)(1/3) f = (1/x3+4/x2+6/x

5、+8)(1/3) simplify(f) ans = (1+4*x+6*x2+8*x3)/x3)(1/3) 3、已知y=cos(x2)*(sin(1/x)2,求y。运行结果如下: syms x y=cos(x2)*(sin(1/x)2) y = cos(x2)*sin(1/x)2 diff(y) ans = -2*sin(x2)*x*sin(1/x)2-2*cos(x2)*sin(1/x)*cos(1/x)/x2第五章1、clearclc(1) a=rands(10,5)a = 0.9003 0.2309 -0.8842 -0.9695 0.6762 -0.5377 0.5839 -0.294

6、3 0.4936 -0.9607 0.2137 0.8436 0.6263 -0.1098 0.3626 -0.0280 0.4764 -0.9803 0.8636 -0.2410 0.7826 -0.6475 -0.7222 -0.0680 0.6636 0.5242 -0.1886 -0.5945 -0.1627 0.0056 -0.0871 0.8709 -0.6026 0.6924 0.4189 -0.9630 0.8338 0.2076 0.0503 -0.1422 0.6428 -0.1795 -0.4556 -0.5947 -0.3908 -0.1106 0.7873 -0.60

7、24 0.3443 -0.6207 meana=mean(a)meana = 0.1337 0.3611 -0.4302 0.0540 -0.0228 vara=var(a)vara = 0.3572 0.2877 0.2469 0.3220 0.3043 maxa=max(a)(2)maxa = 0.9003 0.8709 0.6263 0.8636 0.6762 mina=min(a)mina = -0.9630 -0.6475 -0.9803 -0.9695 -0.9607(3) sort(a)ans = -0.9630 -0.6475 -0.9803 -0.9695 -0.9607 -

8、0.5377 -0.1886 -0.8842 -0.5947 -0.6207 -0.1106 -0.1795 -0.7222 -0.1627 -0.3908 -0.0871 0.2309 -0.6026 -0.1098 -0.2410 -0.0280 0.4764 -0.6024 -0.0680 -0.1422 0.2137 0.5839 -0.5945 0.0503 0.0056 0.5242 0.7873 -0.4556 0.3443 0.3626 0.6428 0.8338 -0.2943 0.4936 0.4189 0.7826 0.8436 0.2076 0.6924 0.66360

9、.9003 0.8709 0.6263 0.8636 0.67623、已知多项式p1(x)=3x+2,p2(x)=5x2-x+2,p3(x)=x2-0.5,求:(1)p(x)= p1(x) p2(x) p3(x)。(2)p(x)=0的全部根。解:clear clcp1=0,3,2;p2=5,-1,2;p3=1,0,-0.5;p4=conv(p1,p2)p5=conv(p4,p3)x=roots(p5)p4 = 0 15 7 4 4p5 = 0 15.0000 7.0000 -3.5000 0.5000 -2.0000 -2.0000x = 0.7071 0.1000 + 0.6245i 0.1000 - 0.6245i -0.7071 -0.6667 第六章2.设计一个图形用户界面,包含一个坐标轴和三个按钮,单击第一个按钮绘制函数y=的图形;单击第二个按钮,为图形添加网格;单击第三个按钮,清除网格。4.建立演示界面,单击“绘图”按钮,绘制正弦曲线;能够利用单选按钮选择曲线的颜色和线型;单击“清除”按钮,清除曲线。第七章4建立阶跃信号积分运算仿真模型,并观察信号波形。5仿真y(t)=sin(t)-sin(2t)的波形。

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1