vb无效的过程调用或参数
Dimv(1Ton)AsDoubleDimr(1To5)AsDoubleDimq(1To5)AsDoubleForj=1To5r(j)=0NextjForj=1To5If...
Dim v(1 To n) As Double
Dim r(1 To 5) As Double
Dim q(1 To 5) As Double
For j = 1 To 5
r(j) = 0
Next j
For j = 1 To 5
If max(j) = 0 Then
r(j) = 1
Exit For
End If
For i = 1 To n
v(i) = (min(j) + 0.5 * max(j)) / (o(i, j) + 0.5 * max(j))
r(j) = r(j) + w(i) * v(i)
Next i
Next j
For j = 1 To 5
q(j) = (r(j) * ((r(1) ^ -1) ^ 2 + (r(2) ^ -1) ^ 2 + (r(3) ^ -1) ^ 2 + (r(4) ^ -1) ^ 2 + (r(5) ^ -1) ^ 2)) ^ -1Next j
If q(1) <= q(2) And q(1) <= q(3) And q(1) <= q(4) And q(1) <= q(5) Then
clustering2x = 1
ElseIf q(2) <= q(1) And q(2) <= q(3) And q(2) <= q(4) And q(2) <= q(5) Then
clustering2x = 2
ElseIf q(3) <= q(2) And q(3) <= q(1) And q(3) <= q(4) And q(3) <= q(5) Then
clustering2x = 3
ElseIf q(4) <= q(2) And q(4) <= q(3) And q(4) <= q(1) And q(4) <= q(5) Then
clustering2x = 4
ElseIf q(5) <= q(2) And q(5) <= q(3) And q(5) <= q(4) And q(5) <= q(1) Then
clustering2x = 5
q(j) = (r(j) * ((r(1) ^ -1) ^ 2 + (r(2) ^ -1) ^ 2 + (r(3) ^ -1) ^ 2 + (r(4) ^ -1) ^ 2 + (r(5) ^ -1) ^ 2)) ^ -1这句有问题 谢谢了
是不是r(1)r(2)不能直接拿来用啊 展开
Dim r(1 To 5) As Double
Dim q(1 To 5) As Double
For j = 1 To 5
r(j) = 0
Next j
For j = 1 To 5
If max(j) = 0 Then
r(j) = 1
Exit For
End If
For i = 1 To n
v(i) = (min(j) + 0.5 * max(j)) / (o(i, j) + 0.5 * max(j))
r(j) = r(j) + w(i) * v(i)
Next i
Next j
For j = 1 To 5
q(j) = (r(j) * ((r(1) ^ -1) ^ 2 + (r(2) ^ -1) ^ 2 + (r(3) ^ -1) ^ 2 + (r(4) ^ -1) ^ 2 + (r(5) ^ -1) ^ 2)) ^ -1Next j
If q(1) <= q(2) And q(1) <= q(3) And q(1) <= q(4) And q(1) <= q(5) Then
clustering2x = 1
ElseIf q(2) <= q(1) And q(2) <= q(3) And q(2) <= q(4) And q(2) <= q(5) Then
clustering2x = 2
ElseIf q(3) <= q(2) And q(3) <= q(1) And q(3) <= q(4) And q(3) <= q(5) Then
clustering2x = 3
ElseIf q(4) <= q(2) And q(4) <= q(3) And q(4) <= q(1) And q(4) <= q(5) Then
clustering2x = 4
ElseIf q(5) <= q(2) And q(5) <= q(3) And q(5) <= q(4) And q(5) <= q(1) Then
clustering2x = 5
q(j) = (r(j) * ((r(1) ^ -1) ^ 2 + (r(2) ^ -1) ^ 2 + (r(3) ^ -1) ^ 2 + (r(4) ^ -1) ^ 2 + (r(5) ^ -1) ^ 2)) ^ -1这句有问题 谢谢了
是不是r(1)r(2)不能直接拿来用啊 展开
展开全部
给你改的:
把:
For j = 1 To 5
q(j) = (r(j) * ((r(1) ^ -1) ^ 2 + (r(2) ^ -1) ^ 2 + (r(3) ^ -1) ^ 2 + (r(4) ^ -1) ^ 2 + (r(5) ^ -1) ^ 2)) ^ -1
Next j
改成:
Dim zzc(1 To 5) As Double
For j = 1 To 5
If r(j)=0 then zzc(j) = 0 else zzc(j) = (r(j) ^ -1)^2
Next j
For j = 1 To 5
If r(j)=0 then
q(j) =0
Else
q(j) = (r(j) *( zzc(1) + zzc(2)+ zzc(3)+ zzc(4)+ zzc(5)) ^ -1
End if
Next j
......................张志晨:您的问题==我的课题
把:
For j = 1 To 5
q(j) = (r(j) * ((r(1) ^ -1) ^ 2 + (r(2) ^ -1) ^ 2 + (r(3) ^ -1) ^ 2 + (r(4) ^ -1) ^ 2 + (r(5) ^ -1) ^ 2)) ^ -1
Next j
改成:
Dim zzc(1 To 5) As Double
For j = 1 To 5
If r(j)=0 then zzc(j) = 0 else zzc(j) = (r(j) ^ -1)^2
Next j
For j = 1 To 5
If r(j)=0 then
q(j) =0
Else
q(j) = (r(j) *( zzc(1) + zzc(2)+ zzc(3)+ zzc(4)+ zzc(5)) ^ -1
End if
Next j
......................张志晨:您的问题==我的课题
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询