Matlab大作业_第1页
Matlab大作业_第2页
Matlab大作业_第3页
Matlab大作业_第4页
Matlab大作业_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

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

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论