c = mtimes(aaa, transpose(aaa))
调试运行时到这个调用就出现“out of memory”错误。
请高手指点,急,谢谢!
9 个解决方案
#1
信息太少了,你mtimes函数的声明长什么样子
#2
你开出来的数组太短了:)
#3
把mtimes和transpose的原型给出来看看。
#4
谢谢大家!
mtimes是一个matcom软件里提供的函数,作用是矩阵相乘,
而transpose是一个矩阵转置函数.
把这个事件的代码给出如下(有点长):
其中xx和det数组1行1列,而aaa数组1行12列.
Private Sub Command5_Click()
Dim i, j, vi As Integer
Dim xx(), det(), aaa() As Double
Dim sum, summ As Double
ReDim xx(1 To index1), det(1 To index1), aaa(1 To index1, 1 To rows)
Dim c, Y, yd, yv As Variant
contribute = Val(Text1.text) ''¹±Ï×ÂÊ
For i = 1 To index1
xx(i) = 0
For j = 1 To rows
xx(i) = xx(i) + valuearrayb(i, j)
Next j
xx(i) = xx(i) / (rows)
Next i
For i = 1 To index1
det(i) = 0
For j = 1 To rows
det(i) = det(i) + (valuearrayb(i, j) - xx(i)) ^ 2
Next j
det(i) = det(i) / (rows - 1)
If det(i) = 0 Then
det(i) = 1
End If
Next i
For i = 1 To index1
For j = 1 To rows
aaa(i, j) = (valuearrayb(i, j) - xx(i)) / Sqr(det(i))
Next j
Next i
c = mtimes(aaa, transpose(aaa))
Y = eig(c)
yd = Y(2)
yv = Y(1)
'yd.Show
'yv.Show
Dim tem As Variant
sum = 0
For i = 1 To index1
tem = yd(i, i).Simple
sum = sum + Abs(tem) ' yd.r2(i, i) ' Abs(tem)
Next i
If sum = 0 Then
MsgBox ("ÌØÕ÷ÖµºÍÌØÕ÷ÏòÁ¿¾ùΪÁã")
Exit Sub
End If
Dim temm As Variant
summ = 0
i = index1
Do While summ < contribute '±äÁ¿±ê¼Ç¹±Ï×ÂÊ
temm = yd(i, i).Simple
summ = summ + Abs(temm) / sum
i = i - 1
vi = i
Loop
'Me.Print index1
'Me.Print vi
'ÌØÕ÷ÏòÁ¿Ïò¹±Ï×¾ØÕóת»»
ReDim vector(1 To index1, 1 To index1 - vi)
For i = 1 To index1
For j = 1 To index1 - vi
If yd(i, i).Simple <> 0 Then
vector(i, j) = yv(i, j).Simple / Sqr(yd(i, i).Simple)
End If
If yd(i, i).Simple = 0 Then
vector(i, j) = yv(i, j).Simple
End If
Next j
Next i
Dim max As Double
ReDim di(1 To index1 - vi)
'´æ´¢É¾³ý±äÁ¿ºóµÄÊý×éµÄ»ØÁã
For i = 1 To index1 - vi
indexstringsave(i) = ""
Next i
'ɾ³ý±äÁ¿µÄ¾ßÌå²½Öè
For j = 1 To index1 - vi
max = -10
For i = 1 To index1
If vector(i, j) > max Then
max = vector(i, j)
di(j) = i
End If
Next i
indexstringsave(j) = indexstring(di(j))
Next j
'½«¶ÔÓ¦Ö¸±êµÄÊý¾Ý´æÈëÊýÖµvaluearrayeditÖÐÓÃÓÚдµ½É¸Ñ¡Ö¸±êºóµÄÊý¾Ý±íÖÐ
For i = 1 To index1 - vi
For j = 1 To rows
valuearrayedit(sumnumber + i, j) = valuearrayb(di(i), j)
Debug.Print valuearrayedit(sumnumber + i, j)
Next j
Next i
sumnumber = sumnumber + index1 - vi '±ê¼Ç×Üɸѡָ±ê¸öÊý
'ÔÚÍø¸ñÖÐÏÔʾ
MSFlexGrid3.rows = index1 + 1 'Òª±Èʵ¼Ê¶àÒ»£¬ÒòÓÐÐÐÁбêÌâ
MSFlexGrid3.cols = index1 - vi + 1
For i = 1 To index1 '±êÌ⸳ֵ£¬À´×ÔÉÏÃ渶¸øµÄÎı¾Öµ
MSFlexGrid3.col = 0
MSFlexGrid3.Row = i
MSFlexGrid3.text = indexstring(i)
Next i
For i = 1 To index1 - vi '±êÌ⸳ֵ£¬À´×ÔÉÏÃ渶¸øµÄÎı¾Öµ
MSFlexGrid3.col = i
MSFlexGrid3.Row = 0
MSFlexGrid3.text = "A" & i 'indexstringsave(i)
Next i
For i = 1 To index1
For j = 1 To index1 - vi '±êÌ⸳ֵ£¬À´×ÔÉÏÃæ¼ÆËãµÄÖµ
MSFlexGrid3.Row = i
MSFlexGrid3.col = j
' MSFlexGrid1.ColWidth = 1800
MSFlexGrid3.text = vector(i, j)
Next j
Next i
'**********************************************************
'½«Ñ¡ÔñµÄÒª½øÐÐÒò×Ó·ÖÎöµÄÖ¸±ê±íÏÖ³öÀ´
For i = 1 To index1
List2.AddItem indexstring(i)
Next i
'È¥µôÖ¸±êÃûÏàͬµÄÖ¸±êÃû£¬Òª²»ÔÚlist3ºÍ½¨±íÊÇ»á³öÏÖÖØÃûºÍ´íÎó
For i = 1 To index1 - vi
For j = i + 1 To index1 - vi
If indexstringsave(i) = indexstringsave(j) And j < (index1 - vi) Then
indexstringsave(j) = indexstringsave(j + 1)
End If
If indexstringsave(i) = indexstringsave(j) And j = (index1 - vi) Then
indexstringsave(j) = ""
End If
Next j
Next i
'µÚ¶þ´ÎÈ¥µôÖ¸±êÃûÏàͬµÄÖ¸±êÃû£¬Òª²»ÔÚlist3ºÍ½¨±íÊÇ»á³öÏÖÖØÃûºÍ´íÎó
For i = 1 To index1 - vi
For j = i + 1 To index1 - vi
If indexstringsave(i) = indexstringsave(j) And j < (index1 - vi) Then
indexstringsave(j) = indexstringsave(j + 1)
End If
If indexstringsave(i) = indexstringsave(j) And j = (index1 - vi) Then
indexstringsave(j) = ""
End If
Next j
Next i
'¿ÉÄÜ»¹ÒªµÚÈý´ÎÈ¥
'½«Òò×Ó·ÖÎöºóµÄÖ¸±ê±íÏÖ³öÀ´
For i = 1 To index1 - vi
If indexstringsave(i) <> "" Then
List3.AddItem indexstringsave(i)
End If
Next i
'comclick = comclick + 1 'ÓÃÓÚ¿ØÖÆcommand¿Ø¼þµã»÷µÄ´ÎÊý
index1 = 0
index2 = 0
MSFlexGrid1.Enabled = True
End Sub
Private Sub exit_Click()
Unload Me
End Sub
mtimes是一个matcom软件里提供的函数,作用是矩阵相乘,
而transpose是一个矩阵转置函数.
把这个事件的代码给出如下(有点长):
其中xx和det数组1行1列,而aaa数组1行12列.
Private Sub Command5_Click()
Dim i, j, vi As Integer
Dim xx(), det(), aaa() As Double
Dim sum, summ As Double
ReDim xx(1 To index1), det(1 To index1), aaa(1 To index1, 1 To rows)
Dim c, Y, yd, yv As Variant
contribute = Val(Text1.text) ''¹±Ï×ÂÊ
For i = 1 To index1
xx(i) = 0
For j = 1 To rows
xx(i) = xx(i) + valuearrayb(i, j)
Next j
xx(i) = xx(i) / (rows)
Next i
For i = 1 To index1
det(i) = 0
For j = 1 To rows
det(i) = det(i) + (valuearrayb(i, j) - xx(i)) ^ 2
Next j
det(i) = det(i) / (rows - 1)
If det(i) = 0 Then
det(i) = 1
End If
Next i
For i = 1 To index1
For j = 1 To rows
aaa(i, j) = (valuearrayb(i, j) - xx(i)) / Sqr(det(i))
Next j
Next i
c = mtimes(aaa, transpose(aaa))
Y = eig(c)
yd = Y(2)
yv = Y(1)
'yd.Show
'yv.Show
Dim tem As Variant
sum = 0
For i = 1 To index1
tem = yd(i, i).Simple
sum = sum + Abs(tem) ' yd.r2(i, i) ' Abs(tem)
Next i
If sum = 0 Then
MsgBox ("ÌØÕ÷ÖµºÍÌØÕ÷ÏòÁ¿¾ùΪÁã")
Exit Sub
End If
Dim temm As Variant
summ = 0
i = index1
Do While summ < contribute '±äÁ¿±ê¼Ç¹±Ï×ÂÊ
temm = yd(i, i).Simple
summ = summ + Abs(temm) / sum
i = i - 1
vi = i
Loop
'Me.Print index1
'Me.Print vi
'ÌØÕ÷ÏòÁ¿Ïò¹±Ï×¾ØÕóת»»
ReDim vector(1 To index1, 1 To index1 - vi)
For i = 1 To index1
For j = 1 To index1 - vi
If yd(i, i).Simple <> 0 Then
vector(i, j) = yv(i, j).Simple / Sqr(yd(i, i).Simple)
End If
If yd(i, i).Simple = 0 Then
vector(i, j) = yv(i, j).Simple
End If
Next j
Next i
Dim max As Double
ReDim di(1 To index1 - vi)
'´æ´¢É¾³ý±äÁ¿ºóµÄÊý×éµÄ»ØÁã
For i = 1 To index1 - vi
indexstringsave(i) = ""
Next i
'ɾ³ý±äÁ¿µÄ¾ßÌå²½Öè
For j = 1 To index1 - vi
max = -10
For i = 1 To index1
If vector(i, j) > max Then
max = vector(i, j)
di(j) = i
End If
Next i
indexstringsave(j) = indexstring(di(j))
Next j
'½«¶ÔÓ¦Ö¸±êµÄÊý¾Ý´æÈëÊýÖµvaluearrayeditÖÐÓÃÓÚдµ½É¸Ñ¡Ö¸±êºóµÄÊý¾Ý±íÖÐ
For i = 1 To index1 - vi
For j = 1 To rows
valuearrayedit(sumnumber + i, j) = valuearrayb(di(i), j)
Debug.Print valuearrayedit(sumnumber + i, j)
Next j
Next i
sumnumber = sumnumber + index1 - vi '±ê¼Ç×Üɸѡָ±ê¸öÊý
'ÔÚÍø¸ñÖÐÏÔʾ
MSFlexGrid3.rows = index1 + 1 'Òª±Èʵ¼Ê¶àÒ»£¬ÒòÓÐÐÐÁбêÌâ
MSFlexGrid3.cols = index1 - vi + 1
For i = 1 To index1 '±êÌ⸳ֵ£¬À´×ÔÉÏÃ渶¸øµÄÎı¾Öµ
MSFlexGrid3.col = 0
MSFlexGrid3.Row = i
MSFlexGrid3.text = indexstring(i)
Next i
For i = 1 To index1 - vi '±êÌ⸳ֵ£¬À´×ÔÉÏÃ渶¸øµÄÎı¾Öµ
MSFlexGrid3.col = i
MSFlexGrid3.Row = 0
MSFlexGrid3.text = "A" & i 'indexstringsave(i)
Next i
For i = 1 To index1
For j = 1 To index1 - vi '±êÌ⸳ֵ£¬À´×ÔÉÏÃæ¼ÆËãµÄÖµ
MSFlexGrid3.Row = i
MSFlexGrid3.col = j
' MSFlexGrid1.ColWidth = 1800
MSFlexGrid3.text = vector(i, j)
Next j
Next i
'**********************************************************
'½«Ñ¡ÔñµÄÒª½øÐÐÒò×Ó·ÖÎöµÄÖ¸±ê±íÏÖ³öÀ´
For i = 1 To index1
List2.AddItem indexstring(i)
Next i
'È¥µôÖ¸±êÃûÏàͬµÄÖ¸±êÃû£¬Òª²»ÔÚlist3ºÍ½¨±íÊÇ»á³öÏÖÖØÃûºÍ´íÎó
For i = 1 To index1 - vi
For j = i + 1 To index1 - vi
If indexstringsave(i) = indexstringsave(j) And j < (index1 - vi) Then
indexstringsave(j) = indexstringsave(j + 1)
End If
If indexstringsave(i) = indexstringsave(j) And j = (index1 - vi) Then
indexstringsave(j) = ""
End If
Next j
Next i
'µÚ¶þ´ÎÈ¥µôÖ¸±êÃûÏàͬµÄÖ¸±êÃû£¬Òª²»ÔÚlist3ºÍ½¨±íÊÇ»á³öÏÖÖØÃûºÍ´íÎó
For i = 1 To index1 - vi
For j = i + 1 To index1 - vi
If indexstringsave(i) = indexstringsave(j) And j < (index1 - vi) Then
indexstringsave(j) = indexstringsave(j + 1)
End If
If indexstringsave(i) = indexstringsave(j) And j = (index1 - vi) Then
indexstringsave(j) = ""
End If
Next j
Next i
'¿ÉÄÜ»¹ÒªµÚÈý´ÎÈ¥
'½«Òò×Ó·ÖÎöºóµÄÖ¸±ê±íÏÖ³öÀ´
For i = 1 To index1 - vi
If indexstringsave(i) <> "" Then
List3.AddItem indexstringsave(i)
End If
Next i
'comclick = comclick + 1 'ÓÃÓÚ¿ØÖÆcommand¿Ø¼þµã»÷µÄ´ÎÊý
index1 = 0
index2 = 0
MSFlexGrid1.Enabled = True
End Sub
Private Sub exit_Click()
Unload Me
End Sub
#5
呵呵,乱码是文字解释.:)
#6
没有mtimes和transpose的函数原型,给这么多代码也看不出问题来啊。
还有就是matcom这个东东是什么语言写的?
还有就是matcom这个东东是什么语言写的?
#7
matco应该是个有关数值分析的数据处理软件,具体是用什么语言编写的就不知道了.
如果可以的话我可以把这个软件的安装程序发给您看看.
我QQ:93623782
谢谢了!
如果可以的话我可以把这个软件的安装程序发给您看看.
我QQ:93623782
谢谢了!
#8
我用F8一步一步运行,到上面的:c = mtimes(aaa, transpose(aaa))行就出现
"out of memory"错误, 我整了好长时间了,没辙,谢谢大家!
"out of memory"错误, 我整了好长时间了,没辙,谢谢大家!
#9
没看到mtimes和transpose的函数原型,如果是DLL内的函数总该有个声明吧!
参数(返回值)都不知如何传递怎么看?
c = mtimes(aaa, transpose(aaa))
此句传递的参数可能有误。
初步判断mtimes和transpose的参数应该都是指针(或引用),VB是没有指针的。变通的方法为:
c = mtimes(aaa(1, 1), transpose(aaa(1, 1))
注:数组的首址 = 数组的指针
参数(返回值)都不知如何传递怎么看?
c = mtimes(aaa, transpose(aaa))
此句传递的参数可能有误。
初步判断mtimes和transpose的参数应该都是指针(或引用),VB是没有指针的。变通的方法为:
c = mtimes(aaa(1, 1), transpose(aaa(1, 1))
注:数组的首址 = 数组的指针
#1
信息太少了,你mtimes函数的声明长什么样子
#2
你开出来的数组太短了:)
#3
把mtimes和transpose的原型给出来看看。
#4
谢谢大家!
mtimes是一个matcom软件里提供的函数,作用是矩阵相乘,
而transpose是一个矩阵转置函数.
把这个事件的代码给出如下(有点长):
其中xx和det数组1行1列,而aaa数组1行12列.
Private Sub Command5_Click()
Dim i, j, vi As Integer
Dim xx(), det(), aaa() As Double
Dim sum, summ As Double
ReDim xx(1 To index1), det(1 To index1), aaa(1 To index1, 1 To rows)
Dim c, Y, yd, yv As Variant
contribute = Val(Text1.text) ''¹±Ï×ÂÊ
For i = 1 To index1
xx(i) = 0
For j = 1 To rows
xx(i) = xx(i) + valuearrayb(i, j)
Next j
xx(i) = xx(i) / (rows)
Next i
For i = 1 To index1
det(i) = 0
For j = 1 To rows
det(i) = det(i) + (valuearrayb(i, j) - xx(i)) ^ 2
Next j
det(i) = det(i) / (rows - 1)
If det(i) = 0 Then
det(i) = 1
End If
Next i
For i = 1 To index1
For j = 1 To rows
aaa(i, j) = (valuearrayb(i, j) - xx(i)) / Sqr(det(i))
Next j
Next i
c = mtimes(aaa, transpose(aaa))
Y = eig(c)
yd = Y(2)
yv = Y(1)
'yd.Show
'yv.Show
Dim tem As Variant
sum = 0
For i = 1 To index1
tem = yd(i, i).Simple
sum = sum + Abs(tem) ' yd.r2(i, i) ' Abs(tem)
Next i
If sum = 0 Then
MsgBox ("ÌØÕ÷ÖµºÍÌØÕ÷ÏòÁ¿¾ùΪÁã")
Exit Sub
End If
Dim temm As Variant
summ = 0
i = index1
Do While summ < contribute '±äÁ¿±ê¼Ç¹±Ï×ÂÊ
temm = yd(i, i).Simple
summ = summ + Abs(temm) / sum
i = i - 1
vi = i
Loop
'Me.Print index1
'Me.Print vi
'ÌØÕ÷ÏòÁ¿Ïò¹±Ï×¾ØÕóת»»
ReDim vector(1 To index1, 1 To index1 - vi)
For i = 1 To index1
For j = 1 To index1 - vi
If yd(i, i).Simple <> 0 Then
vector(i, j) = yv(i, j).Simple / Sqr(yd(i, i).Simple)
End If
If yd(i, i).Simple = 0 Then
vector(i, j) = yv(i, j).Simple
End If
Next j
Next i
Dim max As Double
ReDim di(1 To index1 - vi)
'´æ´¢É¾³ý±äÁ¿ºóµÄÊý×éµÄ»ØÁã
For i = 1 To index1 - vi
indexstringsave(i) = ""
Next i
'ɾ³ý±äÁ¿µÄ¾ßÌå²½Öè
For j = 1 To index1 - vi
max = -10
For i = 1 To index1
If vector(i, j) > max Then
max = vector(i, j)
di(j) = i
End If
Next i
indexstringsave(j) = indexstring(di(j))
Next j
'½«¶ÔÓ¦Ö¸±êµÄÊý¾Ý´æÈëÊýÖµvaluearrayeditÖÐÓÃÓÚдµ½É¸Ñ¡Ö¸±êºóµÄÊý¾Ý±íÖÐ
For i = 1 To index1 - vi
For j = 1 To rows
valuearrayedit(sumnumber + i, j) = valuearrayb(di(i), j)
Debug.Print valuearrayedit(sumnumber + i, j)
Next j
Next i
sumnumber = sumnumber + index1 - vi '±ê¼Ç×Üɸѡָ±ê¸öÊý
'ÔÚÍø¸ñÖÐÏÔʾ
MSFlexGrid3.rows = index1 + 1 'Òª±Èʵ¼Ê¶àÒ»£¬ÒòÓÐÐÐÁбêÌâ
MSFlexGrid3.cols = index1 - vi + 1
For i = 1 To index1 '±êÌ⸳ֵ£¬À´×ÔÉÏÃ渶¸øµÄÎı¾Öµ
MSFlexGrid3.col = 0
MSFlexGrid3.Row = i
MSFlexGrid3.text = indexstring(i)
Next i
For i = 1 To index1 - vi '±êÌ⸳ֵ£¬À´×ÔÉÏÃ渶¸øµÄÎı¾Öµ
MSFlexGrid3.col = i
MSFlexGrid3.Row = 0
MSFlexGrid3.text = "A" & i 'indexstringsave(i)
Next i
For i = 1 To index1
For j = 1 To index1 - vi '±êÌ⸳ֵ£¬À´×ÔÉÏÃæ¼ÆËãµÄÖµ
MSFlexGrid3.Row = i
MSFlexGrid3.col = j
' MSFlexGrid1.ColWidth = 1800
MSFlexGrid3.text = vector(i, j)
Next j
Next i
'**********************************************************
'½«Ñ¡ÔñµÄÒª½øÐÐÒò×Ó·ÖÎöµÄÖ¸±ê±íÏÖ³öÀ´
For i = 1 To index1
List2.AddItem indexstring(i)
Next i
'È¥µôÖ¸±êÃûÏàͬµÄÖ¸±êÃû£¬Òª²»ÔÚlist3ºÍ½¨±íÊÇ»á³öÏÖÖØÃûºÍ´íÎó
For i = 1 To index1 - vi
For j = i + 1 To index1 - vi
If indexstringsave(i) = indexstringsave(j) And j < (index1 - vi) Then
indexstringsave(j) = indexstringsave(j + 1)
End If
If indexstringsave(i) = indexstringsave(j) And j = (index1 - vi) Then
indexstringsave(j) = ""
End If
Next j
Next i
'µÚ¶þ´ÎÈ¥µôÖ¸±êÃûÏàͬµÄÖ¸±êÃû£¬Òª²»ÔÚlist3ºÍ½¨±íÊÇ»á³öÏÖÖØÃûºÍ´íÎó
For i = 1 To index1 - vi
For j = i + 1 To index1 - vi
If indexstringsave(i) = indexstringsave(j) And j < (index1 - vi) Then
indexstringsave(j) = indexstringsave(j + 1)
End If
If indexstringsave(i) = indexstringsave(j) And j = (index1 - vi) Then
indexstringsave(j) = ""
End If
Next j
Next i
'¿ÉÄÜ»¹ÒªµÚÈý´ÎÈ¥
'½«Òò×Ó·ÖÎöºóµÄÖ¸±ê±íÏÖ³öÀ´
For i = 1 To index1 - vi
If indexstringsave(i) <> "" Then
List3.AddItem indexstringsave(i)
End If
Next i
'comclick = comclick + 1 'ÓÃÓÚ¿ØÖÆcommand¿Ø¼þµã»÷µÄ´ÎÊý
index1 = 0
index2 = 0
MSFlexGrid1.Enabled = True
End Sub
Private Sub exit_Click()
Unload Me
End Sub
mtimes是一个matcom软件里提供的函数,作用是矩阵相乘,
而transpose是一个矩阵转置函数.
把这个事件的代码给出如下(有点长):
其中xx和det数组1行1列,而aaa数组1行12列.
Private Sub Command5_Click()
Dim i, j, vi As Integer
Dim xx(), det(), aaa() As Double
Dim sum, summ As Double
ReDim xx(1 To index1), det(1 To index1), aaa(1 To index1, 1 To rows)
Dim c, Y, yd, yv As Variant
contribute = Val(Text1.text) ''¹±Ï×ÂÊ
For i = 1 To index1
xx(i) = 0
For j = 1 To rows
xx(i) = xx(i) + valuearrayb(i, j)
Next j
xx(i) = xx(i) / (rows)
Next i
For i = 1 To index1
det(i) = 0
For j = 1 To rows
det(i) = det(i) + (valuearrayb(i, j) - xx(i)) ^ 2
Next j
det(i) = det(i) / (rows - 1)
If det(i) = 0 Then
det(i) = 1
End If
Next i
For i = 1 To index1
For j = 1 To rows
aaa(i, j) = (valuearrayb(i, j) - xx(i)) / Sqr(det(i))
Next j
Next i
c = mtimes(aaa, transpose(aaa))
Y = eig(c)
yd = Y(2)
yv = Y(1)
'yd.Show
'yv.Show
Dim tem As Variant
sum = 0
For i = 1 To index1
tem = yd(i, i).Simple
sum = sum + Abs(tem) ' yd.r2(i, i) ' Abs(tem)
Next i
If sum = 0 Then
MsgBox ("ÌØÕ÷ÖµºÍÌØÕ÷ÏòÁ¿¾ùΪÁã")
Exit Sub
End If
Dim temm As Variant
summ = 0
i = index1
Do While summ < contribute '±äÁ¿±ê¼Ç¹±Ï×ÂÊ
temm = yd(i, i).Simple
summ = summ + Abs(temm) / sum
i = i - 1
vi = i
Loop
'Me.Print index1
'Me.Print vi
'ÌØÕ÷ÏòÁ¿Ïò¹±Ï×¾ØÕóת»»
ReDim vector(1 To index1, 1 To index1 - vi)
For i = 1 To index1
For j = 1 To index1 - vi
If yd(i, i).Simple <> 0 Then
vector(i, j) = yv(i, j).Simple / Sqr(yd(i, i).Simple)
End If
If yd(i, i).Simple = 0 Then
vector(i, j) = yv(i, j).Simple
End If
Next j
Next i
Dim max As Double
ReDim di(1 To index1 - vi)
'´æ´¢É¾³ý±äÁ¿ºóµÄÊý×éµÄ»ØÁã
For i = 1 To index1 - vi
indexstringsave(i) = ""
Next i
'ɾ³ý±äÁ¿µÄ¾ßÌå²½Öè
For j = 1 To index1 - vi
max = -10
For i = 1 To index1
If vector(i, j) > max Then
max = vector(i, j)
di(j) = i
End If
Next i
indexstringsave(j) = indexstring(di(j))
Next j
'½«¶ÔÓ¦Ö¸±êµÄÊý¾Ý´æÈëÊýÖµvaluearrayeditÖÐÓÃÓÚдµ½É¸Ñ¡Ö¸±êºóµÄÊý¾Ý±íÖÐ
For i = 1 To index1 - vi
For j = 1 To rows
valuearrayedit(sumnumber + i, j) = valuearrayb(di(i), j)
Debug.Print valuearrayedit(sumnumber + i, j)
Next j
Next i
sumnumber = sumnumber + index1 - vi '±ê¼Ç×Üɸѡָ±ê¸öÊý
'ÔÚÍø¸ñÖÐÏÔʾ
MSFlexGrid3.rows = index1 + 1 'Òª±Èʵ¼Ê¶àÒ»£¬ÒòÓÐÐÐÁбêÌâ
MSFlexGrid3.cols = index1 - vi + 1
For i = 1 To index1 '±êÌ⸳ֵ£¬À´×ÔÉÏÃ渶¸øµÄÎı¾Öµ
MSFlexGrid3.col = 0
MSFlexGrid3.Row = i
MSFlexGrid3.text = indexstring(i)
Next i
For i = 1 To index1 - vi '±êÌ⸳ֵ£¬À´×ÔÉÏÃ渶¸øµÄÎı¾Öµ
MSFlexGrid3.col = i
MSFlexGrid3.Row = 0
MSFlexGrid3.text = "A" & i 'indexstringsave(i)
Next i
For i = 1 To index1
For j = 1 To index1 - vi '±êÌ⸳ֵ£¬À´×ÔÉÏÃæ¼ÆËãµÄÖµ
MSFlexGrid3.Row = i
MSFlexGrid3.col = j
' MSFlexGrid1.ColWidth = 1800
MSFlexGrid3.text = vector(i, j)
Next j
Next i
'**********************************************************
'½«Ñ¡ÔñµÄÒª½øÐÐÒò×Ó·ÖÎöµÄÖ¸±ê±íÏÖ³öÀ´
For i = 1 To index1
List2.AddItem indexstring(i)
Next i
'È¥µôÖ¸±êÃûÏàͬµÄÖ¸±êÃû£¬Òª²»ÔÚlist3ºÍ½¨±íÊÇ»á³öÏÖÖØÃûºÍ´íÎó
For i = 1 To index1 - vi
For j = i + 1 To index1 - vi
If indexstringsave(i) = indexstringsave(j) And j < (index1 - vi) Then
indexstringsave(j) = indexstringsave(j + 1)
End If
If indexstringsave(i) = indexstringsave(j) And j = (index1 - vi) Then
indexstringsave(j) = ""
End If
Next j
Next i
'µÚ¶þ´ÎÈ¥µôÖ¸±êÃûÏàͬµÄÖ¸±êÃû£¬Òª²»ÔÚlist3ºÍ½¨±íÊÇ»á³öÏÖÖØÃûºÍ´íÎó
For i = 1 To index1 - vi
For j = i + 1 To index1 - vi
If indexstringsave(i) = indexstringsave(j) And j < (index1 - vi) Then
indexstringsave(j) = indexstringsave(j + 1)
End If
If indexstringsave(i) = indexstringsave(j) And j = (index1 - vi) Then
indexstringsave(j) = ""
End If
Next j
Next i
'¿ÉÄÜ»¹ÒªµÚÈý´ÎÈ¥
'½«Òò×Ó·ÖÎöºóµÄÖ¸±ê±íÏÖ³öÀ´
For i = 1 To index1 - vi
If indexstringsave(i) <> "" Then
List3.AddItem indexstringsave(i)
End If
Next i
'comclick = comclick + 1 'ÓÃÓÚ¿ØÖÆcommand¿Ø¼þµã»÷µÄ´ÎÊý
index1 = 0
index2 = 0
MSFlexGrid1.Enabled = True
End Sub
Private Sub exit_Click()
Unload Me
End Sub
#5
呵呵,乱码是文字解释.:)
#6
没有mtimes和transpose的函数原型,给这么多代码也看不出问题来啊。
还有就是matcom这个东东是什么语言写的?
还有就是matcom这个东东是什么语言写的?
#7
matco应该是个有关数值分析的数据处理软件,具体是用什么语言编写的就不知道了.
如果可以的话我可以把这个软件的安装程序发给您看看.
我QQ:93623782
谢谢了!
如果可以的话我可以把这个软件的安装程序发给您看看.
我QQ:93623782
谢谢了!
#8
我用F8一步一步运行,到上面的:c = mtimes(aaa, transpose(aaa))行就出现
"out of memory"错误, 我整了好长时间了,没辙,谢谢大家!
"out of memory"错误, 我整了好长时间了,没辙,谢谢大家!
#9
没看到mtimes和transpose的函数原型,如果是DLL内的函数总该有个声明吧!
参数(返回值)都不知如何传递怎么看?
c = mtimes(aaa, transpose(aaa))
此句传递的参数可能有误。
初步判断mtimes和transpose的参数应该都是指针(或引用),VB是没有指针的。变通的方法为:
c = mtimes(aaa(1, 1), transpose(aaa(1, 1))
注:数组的首址 = 数组的指针
参数(返回值)都不知如何传递怎么看?
c = mtimes(aaa, transpose(aaa))
此句传递的参数可能有误。
初步判断mtimes和transpose的参数应该都是指针(或引用),VB是没有指针的。变通的方法为:
c = mtimes(aaa(1, 1), transpose(aaa(1, 1))
注:数组的首址 = 数组的指针