大连理工大学线代上机.docx
《大连理工大学线代上机.docx》由会员分享,可在线阅读,更多相关《大连理工大学线代上机.docx(17页珍藏版)》请在冰豆网上搜索。
![大连理工大学线代上机.docx](https://file1.bdocx.com/fileroot1/2023-2/11/b7b8a0f3-8b91-4b30-a499-49eddb414add/b7b8a0f3-8b91-4b30-a499-49eddb414add1.gif)
大连理工大学线代上机
软1414叶秀云201492015上机报告
上机作业一
Trial>>A=round(5*rand(5))
B=round(5*rand(5))
C=round(5*rand(5))
b=round(5*rand(5,1))
A+B
A-B
A*B+B*A
inv(A)*b
inv(A)
rank(A)
det(B)
inv(B)
rank(B)
inv(A*B)
rank(A*B)
(B')*(A')
inv(A*B)
inv(B)*inv(A)
inv(A)*C*inv(B)
A=
40113
51520
13554
55245
35453
B=
44422
40322
21243
30544
10014
C=
12454
35131
32314
13311
11415
b=
2
1
1
3
2
ans=
84535
91842
34797
85789
45467
ans=
0-4-3-11
1120-2
-12311
25-301
2544-1
ans=
8053796971
7554747775
89518597102
11077111113123
7941798080
ans=
0.4754
-0.3197
-0.5984
0.9672
-0.0902
ans=
0.3197-0.0164-0.2541-0.20490.3607
-0.84430.28690.19670.8361-0.8115
-0.72130.43440.48360.6803-1.0574
1.4262-0.6885-0.6721-1.60662.1475
-0.32790.10660.40160.5820-0.8443
ans=
5
ans=
418.0000
ans=
-0.01440.43540.0574-0.27270.0191
0.2321-0.20570.0718-0.09090.0239
0.0718-0.1770-0.28710.3636-0.0957
-0.11000.00480.4402-0.0909-0.1866
0.0311-0.1100-0.12440.09090.2919
ans=
5
ans=
-0.80880.33990.30810.8553-1.0211
0.05860.03350.0060-0.0108-0.0407
0.9295-0.4372-0.4747-0.99791.3348
-0.42520.23710.22790.3635-0.5467
0.2265-0.1176-0.0336-0.15920.1809
ans=
5
ans=
2440456158
172592216
2343485960
1940524955
2735596260
ans=
-0.80880.33990.30810.8553-1.0211
0.05860.03350.0060-0.0108-0.0407
0.9295-0.4372-0.4747-0.99791.3348
-0.42520.23710.22790.3635-0.5467
0.2265-0.1176-0.0336-0.15920.1809
ans=
-0.80880.33990.30810.8553-1.0211
0.05860.03350.0060-0.0108-0.0407
0.9295-0.4372-0.4747-0.99791.3348
-0.42520.23710.22790.3635-0.5467
0.2265-0.1176-0.0336-0.15920.1809
ans=
-0.0497-0.5353-0.00600.62890.1291
0.35831.06320.4029-1.7332-0.6608
0.45181.28720.8731-2.1207-0.6844
-0.7394-2.4091-1.64914.05071.6251
0.26580.72080.5187-1.1788-0.5129
Trial>>
上机作业二
Trial>>A=rand(4)
B=rand(4)
C=rand(4)
D=rand(4)
Z=[A,B;C,D]
det(Z)
det(A*D-C*B)
A=diag([randrandrandrand])
C=diag([randrandrandrand])
Z=[A,B;C,D]
det(Z)
det(A*D-C*B)
A=
0.90270.33770.78030.0965
0.94480.90010.38970.1320
0.49090.36920.24170.9421
0.48930.11120.40390.9561
B=
0.57520.82120.64910.5470
0.05980.01540.73170.2963
0.23480.04300.64770.7447
0.35320.16900.45090.1890
C=
0.68680.78020.48680.5085
0.18350.08110.43590.5108
0.36850.92940.44680.8176
0.62560.77570.30630.7948
D=
0.64430.35070.62250.4709
0.37860.93900.58700.2305
0.81160.87590.20770.8443
0.53280.55020.30120.1948
Z=
0.90270.33770.78030.09650.57520.82120.64910.5470
0.94480.90010.38970.13200.05980.01540.73170.2963
0.49090.36920.24170.94210.23480.04300.64770.7447
0.48930.11120.40390.95610.35320.16900.45090.1890
0.68680.78020.48680.50850.64430.35070.62250.4709
0.18350.08110.43590.51080.37860.93900.58700.2305
0.36850.92940.44680.81760.81160.87590.20770.8443
0.62560.77570.30630.79480.53280.55020.30120.1948
ans=
-0.0232
ans=
0.0161
A=
0.2259000
00.170700
000.22770
0000.4357
C=
0.3111000
00.923400
000.43020
0000.1848
Z=
0.22590000.57520.82120.64910.5470
00.1707000.05980.01540.73170.2963
000.227700.23480.04300.64770.7447
0000.43570.35320.16900.45090.1890
0.31110000.64430.35070.62250.4709
00.9234000.37860.93900.58700.2305
000.430200.81160.87590.20770.8443
0000.18480.53280.55020.30120.1948
ans=
7.3868e-04
ans=
7.3868e-04
Trial>>
上机作业三
N=201492015;
a=15;
b=49;
c=01;
d=41;
e=21;
f=95;
g=45;
Trial>>h=90;
Trial>>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];
Trial>>B=rref(A)
B=
1.00000000.41300.9568
01.000000-1.7984-1.4904
001.00000-0.3796-0.3759
0001.00002.08061.5380
N=201492015;
a=15;
b=49;
c=01;
d=41;
e=21;
f=95;
g=45;
Trial>>h=90;
Trial>>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];
Trial>>B=rref(A)
B=
1.00000000.41300.9568
01.000000-1.7984-1.4904
001.00000-0.3796-0.3759
0001.00002.08061.5380
上机作业四
Trial>>b1=[1,1.9,f,c];
Trial>>b2=[1,1.8,f,c];
Trial>>A1=[a,b,c,d;0.5,1,1.5,2;12,15,22,17;e,f,g,h];
Trial>>A2=[a,b,c,d;0.3,0.6,0.9,1.2;12,15,22,17;e,f,g,h];
Trial>>A3=[a,b,c,d;0.1,0.2,0.3,0.4;12,15,22,17;e,f,g,h];
Trial>>A4=[a,b,c,d;0.05,0.1,0.15,0.2;12,15,22,17;e,f,g,h];
Trial>>x1=A1/b1
x1=
0.0270
0.0163
0.2378
0.5057
Trial>>x2=A2/b1
x2=
0.0270
0.0098
0.2378
0.5057
Trial>>x3=A4/b1
x3=
0.0270
0.0016
0.2378
0.5057
Trial>>x4=A4/b1
x4=
0.0270
0.0016
0.2378
0.5057
Trial>>x5=A1/b2
x5=
0.0265
0.0163
0.2376
0.5046
Trial>>x6=A2/b2
x6=
0.0265
0.0098
0.2376
0.5046
Trial>>x7=A3/b2
x7=
0.0265
0.0033
0.2376
0.5046
Trial>>x8=A4/b2
x8=
0.0265
0.0016
0.2376
0.5046
Trial>>
上机作业五
a1=rand(5,1)
a2=rand(5,1)
a3=rand(5,1)
a4=rand(5,1)
a5=rand(5,1)
A=[a1,a2,a3,a4,a5]
orth(A)
a1=
0.9049
0.9797
0.4389
0.1111
0.2581
a2=
0.4087
0.5949
0.2622
0.6028
0.7112
a3=
0.2217
0.1174
0.2967
0.3188
0.4242
a4=
0.5079
0.0855
0.2625
0.8010
0.0292
a5=
0.9289
0.7303
0.4886
0.5785
0.2373
A=
0.90490.40870.22170.50790.9289
0.97970.59490.11740.08550.7303
0.43890.26220.29670.26250.4886
0.11110.60280.31880.80100.5785
0.25810.71120.42420.02920.2373
ans=
-0.5932-0.1881-0.43300.1909-0.6235
-0.5319-0.52860.1934-0.50940.3752
-0.32880.0079-0.06700.73950.5835
-0.41370.8042-0.1828-0.34500.1723
-0.29310.19600.85860.1953-0.3167
Trial>>
上机作业六
Trial>>A=rand(5)
eig(A)
[d,v]=eig(A)
x=rand(5,1)
eig(x*x')
A=
0.45880.48890.98800.09870.7212
0.96310.62410.03770.26190.1068
0.54680.67910.88520.33540.6538
0.52110.39550.91330.67970.4942
0.23160.36740.79620.13660.7791
ans=
2.6238+0.0000i
0.0391+0.2666i
0.0391-0.2666i
0.2420+0.0000i
0.4829+0.0000i
d=
-0.4582+0.0000i-0.4322+0.1366i-0.4322-0.1366i0.1428+0.0000i0.2020+0.0000i
-0.3197+0.0000i0.7401+0.0000i0.7401+0.0000i-0.6192+0.0000i0.3539+0.0000i
-0.5143+0.0000i-0.0341-0.3116i-0.0341+0.3116i-0.2603+0.0000i-0.0520+0.0000i
-0.5266+0.0000i0.0473+0.2327i0.0473-0.2327i0.1237+0.0000i-0.9110+0.0000i
-0.3821+0.0000i-0.2604+0.1558i-0.2604-0.1558i0.7164+0.0000i-0.0373+0.0000i
v=
2.6238+0.0000i0.0000+0.0000i0.0000+0.0000i0.0000+0.0000i0.0000+0.0000i
0.0000+0.0000i0.0391+0.2666i0.0000+0.0000i0.0000+0.0000i0.0000+0.0000i
0.0000+0.0000i0.0000+0.0000i0.0391-0.2666i0.0000+0.0000i0.0000+0.0000i
0.0000+0.0000i0.0000+0.0000i0.0000+0.0000i0.2420+0.0000i0.0000+0.0000i
0.0000+0.0000i0.0000+0.0000i0.0000+0.0000i0.0000+0.0000i0.4829+0.0000i
上机作业七
A=[1,3/2,0;3/2,-1,1;0,1,1]
rref(A)
eig(A)
B=[1,0,2;0,-1,-2;2,-2,0]
rref(B)
eig(B)
A=
1.00001.50000
1.5000-1.00001.0000
01.00001.0000
ans=
100
010
001
ans=
-2.0616
1.0000
2.0616
B=
102
0-1-2
2-20
ans=
102
012
000
ans=
-3.0000
-0.0000
3.0000
Trial>>
上机作业八
Trial>>A=[0.7,0.2,0.1;0.2,0.7,0.1;0.1,0.1,0.8]
P0=[15;9;6]
A=
0.70000.20000.1000
0.20000.70000.1000
0.10000.10000.8000
P0=
15
9
6
Trial>>A*P0
ans=
12.9000
9.9000
7.2000
Trial>>A*A*P0
ans=
11.7300
10.2300
8.0400
Trial>>A*A*A*A*A*P0
ans=
10.4299
10.2424
9.3277
Trial>>