预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共37页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

Matlab上机实验答案 实验一MATLAB运算基础 1.先求下列表达式的值,然后显示MATLAB工作空间的使用情况并保存全部变量。 (1) >>z1=2*sin(85*pi/180)/(1+exp(2)) z1= 0.2375 (2),其中 >>x=[21+2i;-0.455]; >>z2=1/2*log(x+sqrt(1+x^2)) z2= 0.7114-0.0253i0.8968+0.3658i 0.2139+0.9343i1.1541-0.0044i (3) >>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) (>>z33=(exp(0.3*a)-exp(-0.3*a))/2.*sin(a+0.3)+log((0.3+a)/2) 可以验证z3==z33,是否都为1) z3= Columns1through5 0.7388+3.1416i0.7696+3.1416i0.7871+3.1416i0.7913+3.1416i0.7822+3.1416i Columns6through10 0.7602+3.1416i0.7254+3.1416i0.6784+3.1416i0.6196+3.1416i0.5496+3.1416i Columns11through15 0.4688+3.1416i0.3780+3.1416i0.2775+3.1416i0.1680+3.1416i0.0497+3.1416i Columns16through20 -0.0771+3.1416i-0.2124+3.1416i-0.3566+3.1416i-0.5104+3.1416i-0.6752+3.1416i Columns21through25 -0.8536+3.1416i-1.0497+3.1416i-1.2701+3.1416i-1.5271+3.1416i-1.8436+3.1416i Columns26through30 -2.2727+3.1416i-2.9837+3.1416i-37.0245+0.0000i-3.0017+0.0000i-2.3085+0.0000i Columns31through35 -1.8971+0.0000i-1.5978+0.0000i-1.3575+0.0000i-1.1531+0.0000i-0.9723+0.0000i Columns36through40 -0.8083+0.0000i-0.6567+0.0000i-0.5151+0.0000i-0.3819+0.0000i-0.2561+0.0000i Columns41through45 -0.1374+0.0000i-0.0255+0.0000i0.0792+0.0000i0.1766+0.0000i0.2663+0.0000i Columns46through50 0.3478+0.0000i0.4206+0.0000i0.4841+0.0000i0.5379+0.0000i0.5815+0.0000i Columns51through55 0.6145+0.0000i0.6366+0.0000i0.6474+0.0000i0.6470+0.0000i0.6351+0.0000i Columns56through60 0.6119+0.0000i0.5777+0.0000i0.5327+0.0000i0.4774+0.0000i0.4126+0.0000i Column61 0.3388+0.0000i (4),其中t=0:0.5:2.5 >>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.^2-2.*t+1) z4= 00.250001.25001.00002.2500 2.已知: 求下列表达式的值: (1)A+6*B和A-B+I(其中I为单位矩阵) (2)A*B和A.*B (3)A^3和A.^3 (4)A/B及B\A (5)[A,B]和[A([1,3],:);B^2] >>A=[1234-4;34787;3657]; >>B=[13-1;203;3-27]; >>A+6*B ans= 1852-10 467105 215349 >>I=eye(3); >>A-B+I ans= 1231-3 32884 0671 (2) >>A*B ans= 684462 309-72596 154-5241 >>A.*B ans= 121024 680261