版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、.'原理是用方程 h=b0+b1*x+b2*y+b3*x*x+b4*y*y+b5*x*y 來(lái)表達(dá)曲面,h指的是高程異常值,比如WGS84到bj54的高程差,然后根據(jù)6或者6個(gè)以上的公共點(diǎn)求出b0,b1b5,然后如果要求某點(diǎn)的高程值,輸入它的x,y就可以得到高程異常值h,然后利用WGS84的BLH中的H加上高程異常值就可以得到54的高程.'這個(gè)程序經(jīng)過(guò)2011年01月上旬的實(shí)戰(zhàn)精度比較高,不過(guò)存在一個(gè)弱點(diǎn),就是如果北坐標(biāo)比較大,如2333444.555,應(yīng)該先人為的去掉最高位,這樣矩陣運(yùn)算才不會(huì)出異常。這是因?yàn)榫仃囘\(yùn)算的算法不夠完善。有空再解決它。'Code By Kis
2、eigo 2011.01.06 Option ExplicitPrivate Sub cmdCalc_Click() Dim matA() As Double Dim matB() As Double ReDim matA(6, 5) As Double '7個(gè)已知點(diǎn) ReDim matB(6, 0) As Double Call SetKnownValueAB(matA, matB) Dim arrPara() As Double 'b0,b1,b2b6這6個(gè)參數(shù) Call CalcB0toB6(matA, matB, arrPara) '計(jì)算b0,b1,b2b6這6
3、個(gè)參數(shù) Dim Hout As Double Hout = calcHfit(11, 3, arrPara) '計(jì)算某位置的高程,這里剛好取已知點(diǎn)來(lái)驗(yàn)算 FrmMain.Caption = Format(Hout, "0.000") '結(jié)果得93.7,說(shuō)明結(jié)果正確End Sub'求高程擬合(二次曲面擬合)的參數(shù)B0,B1,B2,B3,B4,B5,B6 By Kiseigo 2011.01.06 21:53 Helped by BluePan'輸入matA(5,5) 最少6行,也就是最少6個(gè)已知高程點(diǎn)'輸入matB(5, 0) 最少6個(gè)
4、點(diǎn),這里是高程值,matB(0)是第一個(gè)點(diǎn)'輸出:B0toB6Out, 下標(biāo)從0取起,一維數(shù)組,下標(biāo)0-5Public Function CalcB0toB6(matA() As Double, matB() As Double, B0toB6Out() As Double) '假設(shè)方程是 h=b0+b1*x+b2*y+b3*x*x+b4*y*y+b5*x*y; 方程由BluePan提供 Dim maxPt As Integer '公共點(diǎn)個(gè)數(shù),要求>=6個(gè).6表示6個(gè)點(diǎn)。 maxPt = UBound(matA, 1) + 1 '步驟1:加1空行,加1空列
5、.因?yàn)榫仃囘\(yùn)算是從1開始,麻煩 Call RedimMatrisAFrom1Nor0(matA) Call RedimMatrisAFrom1Nor0(matB) '步驟2:計(jì)算 AT * A 矩陣 Dim matAT() As Double 'A的轉(zhuǎn)置矩陣 ReDim matAT(UBound(matA, 2), UBound(matA, 1) Call MTrans(UBound(matAT, 1), UBound(matAT, 2), matA, matAT) '求A的轉(zhuǎn)置矩陣 Dim ATA() As Double 'A的轉(zhuǎn)置*A ReDim ATA(U
6、Bound(matAT, 1), UBound(matA, 2) '方陣 Call MMul(UBound(matAT, 1), UBound(matAT, 2), UBound(matA, 2), matAT, matA, ATA) '計(jì)算ATA(A的轉(zhuǎn)置*A ) '步驟3:計(jì)算(A的轉(zhuǎn)置*A) 的逆矩陣 Dim ATAinv() As Double 'A的轉(zhuǎn)置*A 的逆矩陣 ReDim ATAinv(UBound(ATA, 1), UBound(ATA, 2) Dim i As Integer Dim j As Integer For i = 0 To UB
7、ound(ATA, 1) For j = 0 To UBound(ATA, 2) ATAinv(i, j) = ATA(i, j) Next j Next i Call MRinv(UBound(ATAinv), ATAinv) '輸出ATAinv '步驟4:計(jì)算ATB(A的轉(zhuǎn)置*B ) Dim ATB() As Double 'A的轉(zhuǎn)置*B ReDim ATB(UBound(matAT, 1), UBound(matB, 2) Call MMul(UBound(matAT, 1), UBound(matAT, 2), UBound(matB, 2), matAT, m
8、atB, ATB) '計(jì)算ATB(A的轉(zhuǎn)置*B ) '步驟5: 計(jì)算 (A的轉(zhuǎn)置 * A的逆矩陣) * (A的轉(zhuǎn)置 * B) Dim B0toB6OutWithZero() As Double ReDim B0toB6OutWithZero(UBound(ATAinv, 1), UBound(ATB, 2) As Double Call MMul(UBound(ATAinv, 1), UBound(ATAinv, 2), UBound(ATB, 2), ATAinv, ATB, B0toB6OutWithZero) '把結(jié)果的第一行空行和第一列空列去掉 ReDim B0
9、toB6Out(5) B0toB6Out(0) = B0toB6OutWithZero(1, 1) B0toB6Out(1) = B0toB6OutWithZero(2, 1) B0toB6Out(2) = B0toB6OutWithZero(3, 1) B0toB6Out(3) = B0toB6OutWithZero(4, 1) B0toB6Out(4) = B0toB6OutWithZero(5, 1) B0toB6Out(5) = B0toB6OutWithZero(6, 1) End Function'下標(biāo)都變成從1開始。0下標(biāo)的數(shù)據(jù)都不用,置0.'相對(duì)于在最前加1行和
10、加1列,都是0的行和列Private Function RedimMatrisAFrom1Nor0(mtsA() As Double) Dim a() ReDim a(UBound(mtsA(), 1) + 1, UBound(mtsA(), 2) + 1) Dim i As Integer Dim j As Integer For i = 0 To UBound(mtsA(), 1) For j = 0 To UBound(mtsA(), 2) a(i + 1, j + 1) = mtsA(i, j) Next Next ReDim mtsA(UBound(a, 1), UBound(a,
11、2) For i = 0 To UBound(a(), 1) For j = 0 To UBound(a(), 2) mtsA(i, j) = a(i, j) Next NextEnd Function'設(shè)置測(cè)試數(shù)據(jù)Private Sub SetKnownValueAB(matA() As Double, matB() As Double) '測(cè)試的數(shù)據(jù) Dim x1 As Double Dim y1 As Double Dim x2 As Double Dim y2 As Double Dim x3 As Double Dim y3 As Double Dim x4 As D
12、ouble Dim y4 As Double Dim x5 As Double Dim y5 As Double Dim x6 As Double Dim y6 As Double Dim x7 As Double Dim y7 As Double Dim z1 As Double Dim z2 As Double Dim z3 As Double Dim z4 As Double Dim z5 As Double Dim z6 As Double Dim z7 As Double x1 = 55 y1 = 66 x2 = 11 y2 = 2 x3 = 22 y3 = 9 x4 = 3 y4
13、= 4 x5 = 13 y5 = 11 x6 = 8 y6 = 17 x7 = 11 y7 = 3 z1 = 6710.2 z2 = 82.6 z3 = 439.6 z4 = 25.2 z5 = 265.7 z6 = 310# z7 = 93.7 matA(0, 0) = 1 matA(1, 0) = 1 matA(2, 0) = 1 matA(3, 0) = 1 matA(4, 0) = 1 matA(5, 0) = 1 matA(6, 0) = 1 matA(0, 1) = x1 matA(1, 1) = x2 matA(2, 1) = x3 matA(3, 1) = x4 matA(4,
14、 1) = x5 matA(5, 1) = x6 matA(6, 1) = x7 matA(0, 2) = y1 matA(1, 2) = y2 matA(2, 2) = y3 matA(3, 2) = y4 matA(4, 2) = y5 matA(5, 2) = y6 matA(6, 2) = y7 matA(0, 3) = x1 * x1 matA(1, 3) = x2 * x2 matA(2, 3) = x3 * x3 matA(3, 3) = x4 * x4 matA(4, 3) = x5 * x5 matA(5, 3) = x6 * x6 matA(6, 3) = x7 * x7
15、matA(0, 4) = y1 * y1 matA(1, 4) = y2 * y2 matA(2, 4) = y3 * y3 matA(3, 4) = y4 * y4 matA(4, 4) = y5 * y5 matA(5, 4) = y6 * y6 matA(6, 4) = y7 * y7 matA(0, 5) = x1 * y1 matA(1, 5) = x2 * y2 matA(2, 5) = x3 * y3 matA(3, 5) = x4 * y4 matA(4, 5) = x5 * y5 matA(5, 5) = x6 * y6 matA(6, 5) = x7 * y7 matB(0
16、, 0) = z1 matB(1, 0) = z2 matB(2, 0) = z3 matB(3, 0) = z4 matB(4, 0) = z5 matB(5, 0) = z6 matB(6, 0) = z7End Sub'計(jì)算某位置(a,b)的高程值'輸入: a'輸入: b'輸入: arrParaB0toB6'輸出:calcHfitPublic Function calcHfit(ByVal a As Double, ByVal b As Double, arrParaB0toB6() As Double) As Double calcHfit =
17、arrParaB0toB6(0) + arrParaB0toB6(1) * a + arrParaB0toB6(2) * b + _ arrParaB0toB6(3) * a * a + arrParaB0toB6(4) * b * b + arrParaB0toB6(5) * a * b 'calcHfit = 0.2 + 0.3 * a + 0.4 * b + 0.5 * a * a + 0.6 * b * b + 0.7 * a * b 'x=55, y=66 'x=11, y = 2 'x=22, y = 9 'x=3, y = 4 'x
18、=13, y = 11 'x=8, y = 17 'h=6710.200,82.600,439.600,25.200,265.700,310.000End Function還有矩陣運(yùn)算的代碼沒有貼,因?yàn)閟ina不讓貼那么多代碼。 vb矩陣運(yùn)算的代碼:Option Explicit''''''''''''''''''''''''''''''
19、39;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 模
20、塊名:MatrixModule.bas' 功能: 矩陣運(yùn)算'''''''''''''''''''''''''''''''''''''''''''''''''''''
21、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
22、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
23、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
24、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
25、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''' 功能: 將矩陣轉(zhuǎn)換為顯示字符串&
26、#39; 模塊名:MatrixModule.bas' 函數(shù)名:MatrixToString' 參數(shù): m - Integer型變量,矩陣的行數(shù)' n - Integer型變量,矩陣的列數(shù)' mtxA - Double型m x n二維數(shù)組,存放相加的左邊矩陣' sFormat - 顯示矩陣各元素的格式控制字符串' 返回值:String型,顯示矩陣的字符串''''''''''''''''''''
27、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
28、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
29、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
30、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
31、;Function MatrixToString(M As Integer, N As Integer, mtxA() As Double, sFormat As String) As String Dim i As Integer, j As Integer Dim s As String s = "" For i = 1 To M For j = 1 To N s = s + Format(mtxA(i, j), sFormat) + " " Next j s = s + Chr(13) Next i MatrixToString = sEnd Fu
32、nction'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
33、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
34、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
35、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
36、;''''''''''''''''''''''' 功能: 將矩陣的指定行轉(zhuǎn)換為顯示字符串' 模塊名:MatrixModule.bas' 函數(shù)名:MatrixRowToString' 參數(shù): n - Integer型變量,矩陣的列數(shù)' r - Integer型變量,要顯示的矩陣的行數(shù)' mtxA - Double型m x n二維數(shù)組,存放相加的左邊矩陣' sForma
37、t - 顯示矩陣各元素的格式控制字符串' 返回值:String型,顯示矩陣指定的行向量''''''''''''''''''''''''''''''''''''''''''''''''''
38、9;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
39、9;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
40、9;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
41、9;'''''''''''''''''''''''''''''Function MatrixRowToString(N As Integer, r As Integer, mtxA() As Double, sFormat As String) As String Dim i As Integer, j As Integer Dim s As String s =
42、"" For j = 1 To N s = s + Format(mtxA(r, j), sFormat) + " " Next j MatrixRowToString = sEnd Function''''''''''''''''''''''''''''''''''''
43、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
44、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
45、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
46、'''''''''''''''''''''''''''''''''''''''''''''' 功能: 將矩陣的指定列轉(zhuǎn)換為顯示字符串' 模塊名:MatrixModule.bas' 函數(shù)名:MatrixColToStr
47、ing' 參數(shù): m - Integer型變量,矩陣的行數(shù)' c - Integer型變量,要顯示的矩陣的列數(shù)' mtxA - Double型m x n二維數(shù)組,存放相加的左邊矩陣' sFormat - 顯示矩陣各元素的格式控制字符串' 返回值:String型,顯示矩陣指定的列向量''''''''''''''''''''''''''''
48、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
49、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
50、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
51、;''''''''''''''''''''''''''''''''''''''''''''''''''''Function MatrixColToString(M As Integer
52、, c As Integer, mtxA() As Double, sFormat As String) As String Dim i As Integer, j As Integer Dim s As String s = "" For i = 1 To M s = s + Format(mtxA(i, c), sFormat) + " " Next i MatrixColToString = sEnd Function'''''''''''''&
53、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
54、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
55、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
56、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
57、#39;'''''''' 功能: 計(jì)算矩陣的加法' 模塊名:MatrixModule.bas' 函數(shù)名:MAdd' 參數(shù): m - Integer型變量,矩陣的行數(shù)' n - Integer型變量,矩陣的列數(shù)' mtxA - Double型m x n二維數(shù)組,存放相加的左邊矩陣' mtxB - Double型m x n二維數(shù)組,存放相加的右邊矩陣' mtxC - Double型m x n二維數(shù)組,返回和矩陣'''''''
58、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
59、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
60、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
61、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
62、'''''''''''''Sub MAdd(M As Integer, N As Integer, mtxA() As Double, mtxB() As Double, mtxC() As Double) Dim i As Integer, j As Integer For i = 1 To M For j = 1 To N mtxC(i, j) = mtxA(i, j) + mtxB(i, j) Next j Next iEnd Sub'''''&
63、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
64、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
65、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
66、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
67、#39;'''''''''''''''' 功能: 計(jì)算矩陣的減法' 模塊名:MatrixModule.bas' 函數(shù)名:MSub' 參數(shù): m - Integer型變量,矩陣的行數(shù)' n - Integer型變量,矩陣的列數(shù)' mtxA - Double型m x n二維數(shù)組,存放相減的左邊矩陣' mtxB - Double型m x n二維數(shù)組,存放相減的右邊矩陣' mtxC - Double型m x n二維數(shù)組,
68、返回差矩陣'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
69、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
70、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
71、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
72、'''''''''''''''''''''Sub MSub(M As Integer, N As Integer, mtxA() As Double, mtxB() As Double, mtxC() As Double) Dim i As Integer, j As Integer For i = 1 To M For j = 1 To N mtxC(i, j) = mtxA(i, j) + mtxB(i, j) Next j
73、 Next iEnd Sub'''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
74、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
75、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
76、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
77、#39;'''''''''''''''''''''''' 功能: 計(jì)算矩陣的數(shù)乘' 模塊名:MatrixModule.bas' 函數(shù)名:MNmul' 參數(shù): m - Integer型變量,矩陣的行數(shù)' n - Integer型變量,矩陣的列數(shù)' dblNum - Double型變量,乘數(shù)' mtxA - Double型m x n二維數(shù)組,存放乘數(shù)矩陣'
78、; mtxB - Double型m x n二維數(shù)組,存放數(shù)乘的結(jié)果矩陣'''''''''''''''''''''''''''''''''''''''''''''''''''''
79、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
80、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
81、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
82、'''''''''''''''''''''''''''Sub MNmul(M As Integer, N As Integer, dblNum As Double, mtxA() As Double, mtxB() As Double) Dim i As Integer, j As Integer For i = 1 To M For j = 1 To N mtxB(i, j) =
83、 dblNum * mtxA(i, j) Next j Next iEnd Sub''''''''''''''''''''''''''''''''''''''''''''''''''''
84、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
85、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
86、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
87、;'''''''''''''''''''''''''''''' 功能: 計(jì)算矩陣的轉(zhuǎn)置' 模塊名:MatrixModule.bas' 函數(shù)名:MTrans' 參數(shù): m - Integer型變量,矩陣的行數(shù) 2009.06.30 Kiseigo 注釋 m為輸出矩陣mtxAT的行數(shù)' n - Integer型變量,矩陣的列數(shù)
88、39; mtxA - Double型m x n二維數(shù)組,存放原矩陣' mtxAT - Double型n x m二維數(shù)組,返回轉(zhuǎn)置矩陣''''''''''''''''''''''''''''''''''''''''''''''
89、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
90、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
91、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
92、''''''''''''''''''''''''''''''''''Sub MTrans(M As Integer, N As Integer, mtxA() As Double, mtxAT() As Double) Dim i As Integer, j As Integer For i = 1 To M For j =
93、1 To N mtxAT(i, j) = mtxA(j, i) '2009.06.30 Kiseigo 把右邊的mtxAT修改為mtxA Next j Next iEnd Sub'''''''''''''''''''''''''''''''''''''''''
94、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
95、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
96、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
97、39;'''''''''''''''''''''''''''''''''''''''' 功能: 計(jì)算矩陣的乘法' 模塊名:MatrixModule.bas' 函數(shù)名:MMul' 參數(shù): m - Integer型變量,相乘的左邊矩陣的行數(shù)' n -
98、Integer型變量,相乘的左邊矩陣的列數(shù)和右邊矩陣的行數(shù)' l - Integer型變量,相乘的右邊矩陣的列數(shù)' mtxA - Double型m x n二維數(shù)組,存放相乘的左邊矩陣' mtxB - Double型n x l二維數(shù)組,存放相乘的右邊矩陣' mtxC - Double型m x l二維數(shù)組,返回矩陣乘積矩陣'''''''''''''''''''''''''
99、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
100、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
101、;''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
102、;'''''''''''''''''''''''''''''''''''''''''''''''''''''''Sub MMul(M As Integer, N
103、 As Integer, l As Integer, mtxA() As Double, mtxB() As Double, mtxC() As Double) Dim i As Integer, j As Integer, k As Integer For i = 1 To M For j = 1 To l mtxC(i, j) = 0# For k = 1 To N mtxC(i, j) = mtxC(i, j) + mtxA(i, k) * mtxB(k, j) Next k Next j Next iEnd Sub'''''''&
104、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
105、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
106、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
107、#39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''&
108、#39;'''''''''''''' 功能: 計(jì)算復(fù)矩陣乘法' 模塊名:MatrixModule.bas' 函數(shù)名:MCmul' 參數(shù): m - Integer型變量,相乘的左邊矩陣的行數(shù)' n - Integer型變量,相乘的左邊矩陣的列數(shù)和右邊矩陣的行數(shù)' l - Integer型變量,相乘的右邊矩陣的列數(shù)' mtxAR - Double型m x n二維數(shù)組,存放相乘的左邊矩陣的實(shí)部' mtxAI - Double型m x
109、n二維數(shù)組,存放相乘的左邊矩陣的虛部' mtxBR - Double型n x l二維數(shù)組,存放相乘的右邊矩陣的實(shí)部' mtxBI - Double型n x l二維數(shù)組,存放相乘的右邊矩陣的虛部' mtxCR - Double型m x l二維數(shù)組,返回矩陣乘積矩陣的實(shí)部' mtxCI - Double型m x l二維數(shù)組,返回矩陣乘積矩陣的虛部''''''''''''''''''''''
110、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
111、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
112、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
113、39;'''''''''''''''''''''''''''''''''''''''''''''''''''''''''Sub MCmul(M
114、As Integer, N As Integer, l As Integer, mtxAR() As Double, mtxAI() As Double, _mtxBR() As Double, mtxBI() As Double, mtxCR() As Double, mtxCI() As Double) Dim i As Integer, j As Integer, k As Integer Dim p As Double, q As Double, s As Double For i = 1 To M For j = 1 To l mtxCR(i, j) = 0# mtxCI(i, j)
115、 = 0# For k = 1 To N p = mtxAR(i, k) * mtxBR(k, j) q = mtxAI(i, k) * mtxBI(k, j) s = (mtxAR(i, k) + mtxAI(i, k) * (mtxBR(k, j) + mtxBI(k, j) mtxCR(i, j) = mtxCR(i, j) + p - q mtxCI(i, j) = mtxCI(i, j) + s - p - q Next k Next j Next iEnd Sub''''''''''''
116、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
117、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
118、''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
119、'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' 功能: 矩陣求逆' 模塊名:MatrixModule.bas' 函數(shù)名:MRinv' 參數(shù): n - Integer型變量,矩陣的階數(shù)' mtxA - Double型二維數(shù)組,體積為n x n。存放原矩陣A;返回時(shí)存放其逆矩陣A-1。' 返回值:Boolean型,失敗為False,成功為True''''''''''''''
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 線上線下融合的便利店模式探索-洞察分析
- 勇往直前的我們第7季的觀后感范文(5篇)
- 云環(huán)境下的數(shù)據(jù)共享模式-洞察分析
- 頭孢替唑與其他抗生素聯(lián)合用藥的成本效益分析-洞察分析
- 物流隱私保護(hù)技術(shù)融合-洞察分析
- 微電網(wǎng)與配電箱融合-洞察分析
- 頭頸部腫瘤個(gè)體化治療-洞察分析
- 創(chuàng)新驅(qū)動(dòng)的生物醫(yī)藥產(chǎn)業(yè)發(fā)展策略
- 農(nóng)村金融創(chuàng)新與農(nóng)業(yè)現(xiàn)代化協(xié)同發(fā)展
- 醫(yī)學(xué)農(nóng)業(yè)科技的創(chuàng)新進(jìn)展及其影響
- 最新 場(chǎng)地平整施工方案
- 列方程解應(yīng)用題.(課堂PPT)
- 關(guān)于廣州番禺龍沙國(guó)際港口物流園龍沙碼頭二期工程可行性研
- 酒店管理權(quán)限權(quán)限表——酒店管理人員折扣權(quán)限匯總表2016(葉予舜)
- 北京市海淀區(qū)2021-2022學(xué)年七年級(jí)第一學(xué)期期末考試語(yǔ)文試卷[附答案]
- 二氧化碳充裝操作規(guī)程完整
- 植草溝施工方案
- 手術(shù)室護(hù)士分級(jí)培訓(xùn)計(jì)劃(共4頁(yè))
- 苯-甲苯浮閥塔精餾課程設(shè)計(jì).doc
- 【雙人相聲劇本搞笑短篇】雙人校園相聲劇本搞笑
- 基本邏輯門電路教案
評(píng)論
0/150
提交評(píng)論