MATLAB仿真及电子信息应用答案_第1页
MATLAB仿真及电子信息应用答案_第2页
MATLAB仿真及电子信息应用答案_第3页
MATLAB仿真及电子信息应用答案_第4页
MATLAB仿真及电子信息应用答案_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

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

文档简介

1、精选优质文档-倾情为你奉上MATLAB仿真及电子信息应用第二单元1. a=zeros(2)a = 0 0 0 0 a(1,2)=2a = 0 2 0 02. a=1 0 -2 3;b=0 1 2 1; a+bans = 1 1 0 4 a.*bans = 0 0 -4 3 /-4+3 =-1 dot(a,b)ans =-13. a=randn(4)a = 0.8156 1.1908 -1.6041 -0.8051 0.7119 -1.2025 0.2573 0.5287 1.2902 -0.0198 -1.0565 0.21930.6686 -0.1567 1.4151 -0.9219 sum

2、(diag(a)ans = -2.3652 reshape(a,2,8)ans = 0.8156 1.2902 1.1908 -0.0198 -1.6041 -1.0565 -0.8051 0.21930.7119 0.6686 -1.2025 -0.1567 0.2573 1.4151 0.5287 -0.92194. a=rand(3,5)a = 0.9501 0.4860 0.4565 0.4447 0.9218 0.2311 0.8913 0.0185 0.6154 0.73820.6068 0.7621 0.8214 0.7919 0.1763 a(:,4)=a(:,4)+0.2a

3、= 0.9501 0.4860 0.4565 0.6447 0.9218 0.2311 0.8913 0.0185 0.8154 0.73820.6068 0.7621 0.8214 0.9919 0.1763 lt(a,0.5)ans = 0 1 1 0 0 1 0 1 0 0 0 0 0 0 15. a=randn(3,2);b=randn(3,2); cat(1,a,b) /按列方向ans = 0.7310 0.6771 0.5779 0.5689 0.0403 -0.2556 -0.3775 -0.2340 -0.2959 0.1184 -1.4751 0.3148 cat(2,a,b

4、) /按行方向ans = 0.7310 0.6771 -0.3775 -0.2340 0.5779 0.5689 -0.2959 0.11840.0403 -0.2556 -1.4751 0.31486. Hello everyoneans =Hello everyone7. str1=MATLAB ;str2 =is strong;str3=str1,str2str3 =MATLAB is strong8.(1)直接法 a=Function Variable;y=f(x) x;6 1:5a = Function Variable y=f(x) x 6 1x5 double(2)函数法 a=c

5、ell(3,2);a1,1=Function;a1,2=Variable; a2,1=y=f(x);a2,2=x; a3,1=6;a3,2=1:5; aa = Function Variable y=f(x) x 6 1x5 double9. student1.Name=Mary;student1.Age=Eighteen;student1.Score=502;student1.Class=1;student1student1 = Name: Mary Age: Eighteen Score: 502Class: 1 student2.Name=Mike;student2.Age=Nighte

6、en; student2.Score=498;student2.Class=2; student2student2 = Name: Mike Age: Nighteen Score: 498Class: 2 student3.Name=Joe;student3.Age=Eighteen; student3.Score=520;student3.Class=3;student3student3 = Name: Joe Age: Eighteen Score: 520 Class: 3第三单元3-1clear allclcp=5 4 1 2 1;roots(p) %求根y=polyval(p,5)

7、 %求在5处函数的函数值3-2clear allclcp=2 0 -2 5;x=1 2 4;-1 0 3;5 2 1;f=polyder(p) %多项式求导polyvalm(p,x)3-3clear allclcf=factor(sym(2*x4-5*x3+4*x2-5*x+2)3-4clear allclcf1=sym(x2+1)(x-2);f2=sym(2*x2+1);f=expand(f1*f2)3-5clear allclcsyms x y;f=log(1+x);g=2*sin(y);compose(f,g)compose(g,f)3-6clear allclcsyms x ;finv

8、erse(cos(1+x)3-7(1)(2)clear allclcsyms x y k;f1=(1/2x)+(-1)x/x2);f2=1/(1+k2) 1/(2*k+1)s1=symsum(f1,1,inf)s2=symsum(f2,1,inf)(3)(4)(5)(6) clear allclcsyms x ;f1=(1+2x)(1/x);f2=(x2)*exp(1/x2);f3=log(tan(x)/sin(x);f4=(x/(2*x+1)(x-1);limit(f1,inf)limit(f2,0)limit(f3,x,0,right)limit(f4,inf)(7)(8)clear al

9、lclcsyms x y z a b;f1=1/(1+x2);f2=(x2+y2+z2);int(f1,x,a,b)int(int(int(f2,z,sqrt(x*y),x*y),y,sqrt(x),x),x,0,1)3-8clear allclcsyms x;f=x*exp(x) log(sin(x);1/(1+x2) x(3/2);diff(f,2)3-9(1)clear allclcf=sym(x3-2*x+5);solve(f)(2)clear allclcsyms x1 x2 x3;f1=2*x1-5*x2+3;f2=5*x1-2*x2+18;x1 x2=solve(f1,f2)(3

10、)方法一:clear allclcsyms x1 x2 x3;f1=3*x1+11*x2-2*x3-8;f2=1*x1+1*x2-2*x3+4;f3=x1-x2+x3-3;x1 x2 x3=solve(f1,f2,f3)方法二:clear allclcA=3 11 -2;1 1 -2;1 -1 1;B=8;-4;3;x=AB(4)clear allclcsyms x1 x2 x3;f1=2*x1-x2-exp(-x1);f2=x1-2*x2-exp(-x2);x1 x2=solve(f1,f2)3-10clear allclcdsolve(D2y+2*Dy+2*y=0,y(0)=0,Dy(0)=1)3-11clear allclcx y=dsolve(Dx=y,Dy=(-

温馨提示

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

最新文档

评论

0/150

提交评论