大连理工大学线性代数实验上机报告_第1页
大连理工大学线性代数实验上机报告_第2页
大连理工大学线性代数实验上机报告_第3页
已阅读5页,还剩34页未读 继续免费阅读

下载本文档

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

文档简介

1、大连理工大学线性代数实验上机报告大连理工大学线性代数实验上机报告实验一首先随机生成五阶方阵 AA=rand(5)A =0.81470.09750.15760.14190.65570.90580.27850.97060.42180.03570.12700.54690.95720.91570.84910.91340.95750.48540.79220.93400.63240.96490.80030.95950.6787>> B=rand(5) 随机生成五阶方阵 B B =0.75770.70600.82350.43870.48980.74310.03180.69480.38160.44

2、560.39220.27690.31710.76550.64630.65550.04620.95020.79520.70940.1712 0.0971 0.0344 0.1869 0.7547>> b=rand(1,5)' 随机生成列向量 b b =0.27600.67970.65510.16260.1190计算 A+B>> A+Bans =1.57250.80360.98110.58061.14551.64890.31031.66540.80330.48130.51920.82381.27431.68131.49541.56891.00371.43561.58

3、741.64340.80351.06200.83471.14641.4334计算 A-B >> A-BqV=x «搦阴q=xv來9L8SCOZLLC68SSCZ8ZZL09£L£0ZL6西眈P9Z9£P176Z6S61706C17£Z9£170LSC01/乙1789SCZ£Z0£01700CZ96LS17606217£OL£9ZSZS6£l7L£890CS88S0C=sue09Z00-9SZZ0899Z08Z980即 91/0917220ocooo-8mo-

4、63;14606Z9S082020209 L0L0W000Z2029920660170-SOWO89ZS0Z917S0ZS9L0099L069620-89990-98090-0Z900=sue-0.98502.43963.3124-5.65151.7085 验证克莱姆法则 >> c=A(:,1)c =0.81470.90580.12700.91340.6324>> d=A(:,2)d =0.09750.27850.54690.95750.9649 >> e=A(:,3) e =0.15760.97060.95720.48540.8003 >> f

5、=A(:,4) f =0.14190.4218 0.91570.7922 0.9595>> g=A(:,5)g =0.65570.03570.84910.93400.6787>> B1=b'd'e'f'g''B1 =0.27600.09750.15760.14190.65570.67970.27850.97060.42180.03570.65510.54690.95720.91570.84910.16260.95750.48540.79220.93400.11900.96490.80030.95950.6787>&g

6、t; B2=c'b'e'f'g''B2 =0.81470.27600.15760.14190.65570.90580.67970.97060.42180.03570.12700.65510.95720.91570.84910.91340.16260.48540.79220.93400.63240.11900.80030.95950.6787>> B3=c'd'b'f'g''B3 =0.81470.09750.27600.14190.65570.90580.27850.67970.4218

7、0.03570.12700.54690.65510.91570.84910.91340.95750.16260.79220.93400.63240.96490.11900.95950.6787>> B4=c'd'e'b'g''B4 =0.81470.09750.15760.27600.65570.90580.27850.97060.67970.03570.12700.54690.95720.65510.84910.91340.95750.48540.16260.93400.63240.96490.80030.11900.6787>

8、;> B5=c'd'e'f'b''B5 =0.81470.09750.15760.14190.27600.90580.27850.97060.42180.67970.12700.54690.95720.91570.65510.91340.95750.48540.79220.16260.63240.96490.80030.95950.1190>> x1=det(B1)/det(A) x1 =-0.9850>> x2=det(B2)/det(A) x2 =2.4396>> x3=det(B3)/det(A)

9、x3 =3.3124>> x4=det(B4)/det(A) x4 =-5.6515>> x5=det(B5)/det(A)x5 =1.7085 计算 A 的行列式 >> det(A)ans =-0.0250计算 B 的行列式>> det(B)ans =0.0647求 A 的逆>> inv(A)ans =3.1375 -0.8078 -1.8788 -4.2194 5.1680-8.60763.53142.890713.7204-14.3665-6.28243.72203.613210.0084-12.419013.6173-6.88

10、22-6.3938-23.528827.5825-2.52921.07292.41935.8870-7.2671求 B 的逆>> inv(B)ans =-0.44303.49971.3255-2.6005-0.46971.4047-1.16260.2422-0.4475-0.01190.7210-1.8189-2.06352.44340.0765-0.6122-0.18372.01650.0375-1.25640.0384-0.5157-0.73700.52671.7407求 A 的秩 >> rank(A) ans =5 求 B 的秩>> rank(B)an

11、s =5求 A*B 的行列式 >> det(A*B)ans =-0.0016求 A*B 的逆>> inv(A*B)ans =74.0649 35.0433 31.2288 121.5740 -137.34426.8291-1.2718-2.2922-8.99518.697263.9620-31.4202-29.5061-105.6918 122.3246-9.31965.74524.625911.9660-15.402811.9582-6.3521-3.3817-16.757418.6360>> rank(A*B)ans =5>> det(A)*

12、det(B)ans =-0.0016验证 AB T BTAT, AB 1 B 1A 1,AB BA(1)>> (A*B)'ans =0.95691.55661.62372.27322.25520.69220.94010.49690.93710.80900.94611.64921.68752.35632.38000.75071.58871.88401.94212.14811.13991.52122.21492.45452.4497>> B'*A'ans =0.95691.55661.62372.27322.25520.69220.94010.496

13、90.93710.80900.94611.64921.68752.35632.38000.75071.58871.88401.94212.14811.13991.52122.21492.45452.4497(2)>> inv(B)*inv(A)ans =74.0649 35.0433 31.2288 121.5740 -137.34426.8291-1.2718-2.2922-8.99518.697263.9620-31.4202-29.5061-105.6918 122.3246-9.31965.74524.625911.9660-15.402811.9582-6.3521-3.

14、3817-16.757418.63603)>> A*Bans =0.95690.69220.94610.75071.13991.55660.94011.64921.58871.52121.62370.49691.68751.88402.21492.27320.93712.35631.94212.45452.25520.80902.38002.14812.4497>> B*Aans =2.07191.61352.19781.97691.96351.35281.25661.35491.48501.73721.71861.64541.52291.68941.69001.871

15、42.04232.01132.29322.46250.87970.96970.84890.96900.8317求矩阵 X 使得 AXB=C 首先随机生成五阶方阵 C >> C=rand(5)0.4984 0.7513 0.9593 0.8407 0.35000.9597 0.2551 0.5472 0.2543 0.19660.34040.50600.13860.81430.25110.58530.69910.14930.24350.61600.22380.89090.25750.92930.4733X=A的逆 *B 的逆>> X=inv(A)*C*inv(B)3.84

16、32-13.88582.14189.4404-4.5871-9.331241.9602-7.910128.468314.8942-7.873835.1218-5.410722.886110.158116.7545-75.607914.678449.3951-24.7450-3.556817.0848-2.901811.26705.4559实验二1. 验证:对于一般的方阵A,B,C,D ,AD B C首先随机生成方阵 A,B,C,DA=rand(5)0.82580.10670.86870.43140.13610.53830.96190.08440.91060.86930.99610.00460.

17、39980.18180.57970.07820.77490.25990.26380.54990.44270.81730.80010.14550.1450>> B=rand(5)0.85300.07600.41730.48930.78030.62210.23990.04970.33770.38970.35100.12330.90270.90010.24170.51320.18390.94480.36920.40390.40180.24000.49090.11120.0965C=rand(5)0.1320 0.2348 0.1690 0.5470 0.18350.94210.35320

18、.64910.29630.36850.95610.82120.73170.74470.62560.57520.01540.64770.18900.78020.05980.04300.45090.68680.0811>> D=rand(5)0.92940.30630.64430.93900.20770.77570.50850.37860.87590.30120.48680.51080.81160.55020.47090.43590.81760.53280.62250.23050.44680.79480.35070.58700.8443Z=A,B;C,D0.8258 0.1067 0.

19、8687 0.4314 0.13610.85300.07600.41730.48930.53830.96190.08440.91060.62210.23990.04970.33770.99610.00460.39980.18180.35100.12330.90270.90010.07820.77490.25990.26380.51320.18390.94480.36920.44270.81730.80010.14550.40180.24000.49090.11120.13200.23480.16900.54700.92940.30630.64430.93900.94210.35320.6491

20、0.29630.77570.50850.37860.87590.95610.82120.73170.74470.48680.51080.81160.55020.57520.01540.64770.18900.43590.81760.53280.62250.05980.04300.45090.68680.44680.79480.35070.58700.7803求 Z 的行列式0.86930.38970.57970.24170.54990.40390.14500.09650.18350.20770.36850.30120.62560.47090.78020.23050.08110.8443>

21、> det(Z)ans =-0.0295求 det(A)*det(D)-det(B)*det(C)>> det(A)*det(D)-det(B)*det(C)ans =1.8656e-004 随机生成对角矩阵 A>> A=diag(rand rand rand rand rand)A =0.1948 0 0000 0.2259 0000 0 0.170700000 0.2277 0000 0 0.4357随机生成对角矩阵 B >> B=diag(rand rand rand rand rand)0.3111 00000 0.92340000 0 0.4

22、30200000 0.1848 0000 0 0.9049随机生成对角矩阵C>> C=diag(rand rand rand rand rand)C =0.9797 00000 0.43890000 0 0.111100000 0.2581 0000 0 0.4087随机生成对角矩阵D>> D=diag(rand rand rand rand rand)0 0.2622 0 0 0000.6028 0 0000 0.7112 0000 0 0.2217>> Z=A,B;C,DZ =0.194800000.3111000000.225900000.923400

23、0000.170700000.4302000000.227700000.1848000000.435700000.90490.9797 0 0 0 00 0.4389 0 0 00 0.2622 0 0 00.11110 00 00 00 00 00 0 计算 Z 的行列式 >> det(Z)ans =-1.1243e-0040 00.6028 0 00 0.2581 00 0.7112 00 0 0.40870 0 0.2217计算 det(A)*det(D)-det(B)*det(C)>> det(A)*det(D)-det(B)*det(C)ans =-9.310

24、7e-005计算 A*D-B*C 的行列式>> det(A*D-B*C) ans =-1.1243e-004实验三求 A 列向量组的一个最大无关组,并把不属于 极大无关组的向量利用极大无关组表示 .N= 200865083;a=83;b=86;c=50;d=88;e=28;f=63;g=83;h=60;>>A=a,b,c,d,3,4;1,2,3,4,4,3;12,15,22,17,5,7;e,f,g,h, 8,0;>> B=rref(A)1.0000 0 0 0 -0.35480.46560 1.0000 0 0 -1.4905-2.00200 0 1.00

25、00 0 0.04730.39500 0 0 1.0000 1.79841.3383所以 a1,a2,a3,a4 是一个极大无关组。 a5=-0,3548a1-1.4905a2+0.0473a3+1.7984a4; a6=0.4656a1-2.0020a2+0.3950a3+1.3383a4.实验四>> a=83;>> b=86;>> c=50;>> d=88;>> e=28;>> f=63;>> g=83;>> h=60;>> b1=1,1.9,f,c;b2=1,1.8,f,c;A1=

26、a,b,c,d;0.5,1,1.5,2;12,15,22,17;e,f,g,h;A2=a,b,c,d;0.3,0.6,0.9,1.2;12,15,22,17;e,f,g,h;A3=a,b,c,d;0.1,0.2,0.3,0.4;12,15,22,17;e,f,g,h;A4=a,b,c,d;0.05,0.1,0.15,0.2;12,15,22,17;e,f,g,h;>> x1=A1/b1x1 =1.20430.03040.35171.2940>> x2=A2/b1x2 =1.20430.01820.35171.2940>> x3=A3/b1x3 =1.2043

27、0.00610.35171.2940>> x4=A4/b1x4 =1.20430.00300.35171.2940>> x5=A2/b1x5 =1.20430.01820.35171.2940>> x6=A2/b2x6 =1.20310.01820.35141.2931>> x5=A1/b2x5 =1.20310.03040.35141.2931>> x6=A2/b2x6 =1.20310.01820.35141.2931>> x7=A3/b2x7 =1.20310.00610.35141.2931>> x8=

28、A4/b2 x8 =1.20310.00300.35141.2931实验五随机生成 4 个 5 维向量,并进行正交化随机生成 4个 5维向量a=rand(4,5);>> aa =0.11740.50790.02920.57850.54680.29670.08550.92890.23730.52110.31880.26250.73030.45880.23160.42420.80100.48860.96310.4889正交化>> b=null(a)0.6777-0.5941-0.30090.28920.1163实验六随机生成 5 阶矩阵 ,求其特征值及对应特征向量eig(A

29、)ans =3.20370.5684-0.1026 + 0.5388i-0.1026 - 0.5388i-0.0457>> d,v=eig(A)0.2283-0.53540.0179 + 0.1710i0.0179- 0.1710i-0.13830.32430.14990.70770.70770.46290.51410.7181-0.1450 + 0.3831i-0.1450- 0.3831i0.31060.5300-0.4077-0.33020.3239i-0.3302 + 0.3239i-0.79140.54550.0944-0.1645 -0.2465i-0.1645 + 0.2465i0.2091d 的每一列即为一个特征向量3.2037000000.568400000-0.1026 + 0.5388i00000-0.10260.5388i00000-0.0457V中非零值即为每一列特征向量对应的特征值随机生成 5 维列向量 x第一组>> X=rand(1,5)'0.60200.26300.65410.68920.7482 求 X*X'>> X*X'ans =0.36240.15830.39370.41490.45040.15830.06920.17200.18120.19670.

温馨提示

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

评论

0/150

提交评论