欢迎来到天天文库
浏览记录
ID:59279296
大小:1.46 MB
页数:83页
时间:2020-09-07
《matlab程序设计与应用(刘卫国编)课后实验答案.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、..实验一MATLAB运算基础1.先求下列表达式的值,然后显示MATLAB工作空间的使用情况并保存全部变量。(1)(2),其中(3)(4),其中t=0:0.5:2.5解:M文件:z1=2*sin(85*pi/180)/(1+exp(2))x=[21+2*i;-.455];z2=1/2*log(x+sqrt(1+x^2))a=-3.0:0.1:3.0;z3=(exp(0.3.*a)-exp(-0.3.*a))./2.*sin(a+0.3)+log((0.3+a)./2)t=0:0.5:2.5;z4=(t>=0&t<1).*(t.^2)+
2、(t>=1&t<2).*(t.^2-1)+(t>=2&t<3).*(t.^2-2*t+1)a..运算结果:z1=2*sin(85*pi/180)/(1+exp(2))x=[21+2*i;-.455];z2=1/2*log(x+sqrt(1+x^2))a=-3.0:0.1:3.0;z3=(exp(0.3.*a)-exp(-0.3.*a))./2.*sin(a+0.3)+log((0.3+a)./2)t=0:0.5:2.5;z4=(t>=0&t<1).*(t.^2)+(t>=1&t<2).*(t.^2-1)+(t>=2&t<3).*(t.
3、^2-2*t+1)z1=0.2375z2=a..0.7114-0.0253i0.8968+0.3658i0.2139+0.9343i1.1541-0.0044iz3=Columns1through40.7388+3.1416i0.7696+3.1416i0.7871+3.1416i0.7913+3.1416iColumns5through80.7822+3.1416i0.7602+3.1416i0.7254+3.1416i0.6784+3.1416iColumns9through12a..0.6196+3.1416i0.5496+3.
4、1416i0.4688+3.1416i0.3780+3.1416iColumns13through160.2775+3.1416i0.1680+3.1416i0.0497+3.1416i-0.0771+3.1416iColumns17through20-0.2124+3.1416i-0.3566+3.1416i-0.5104+3.1416i-0.6752+3.1416iColumns21through24-0.8536+3.1416i-1.0497+3.1416i-1.2701+3.1416i-1.5271+3.1416ia..Col
5、umns25through28-1.8436+3.1416i-2.2727+3.1416i-2.9837+3.1416i-37.0245Columns29through32-3.0017-2.3085-1.8971-1.5978Columns33through36-1.3575-1.1531-0.9723-0.8083Columns37through40a..-0.6567-0.5151-0.3819-0.2561Columns41through44-0.1374-0.02550.07920.1766Columns45through4
6、80.26630.34780.42060.4841Columns49through520.53790.58150.61450.6366a..Columns53through560.64740.64700.63510.6119Columns57through600.57770.53270.47740.4126Column610.3388z4=00.250001.25001.0000a..2.25002.已知:求下列表达式的值:(1)A+6*B和A-B+I(其中I为单位矩阵)(2)A*B和A.*B(3)A^3和A.^3(4)A/B及BA
7、(5)[A,B]和[A([1,3],:);B^2]解:M文件:A=[1234-4;34787;3657];B=[13-1;203;3-27];A+6.*BA-B+eye(3)A*BA.*BA^3A.^3a..A/BBA[A,B][A([1,3],:);B^2]运算结果:A=[1234-4;34787;3657];B=[13-1;203;3-27];A+6.*BA-B+eye(3)A*BA.*BA^3A.^3A/BBA[A,B][A([1,3],:);B^2]ans=1852-10467105215349a..ans=1231-33
8、28840671ans=684462309-72596154-5241ans=1210246802619-13049a..ans=372262338244860424737014918860076678688454142
此文档下载收益归作者所有