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)不能直接拿来用啊
展开
 我来答
xlzzc
2011-08-17 · TA获得超过7301个赞
知道大有可为答主
回答量:4205
采纳率:50%
帮助的人:1432万
展开全部
给你改的:
把:
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

......................张志晨:您的问题==我的课题
lxz1969
2011-08-17 · TA获得超过1.1万个赞
知道大有可为答主
回答量:8524
采纳率:33%
帮助的人:1.1亿
展开全部
程序运行到这一句时r(1)、r(2)、r(3)、r(4)、r(5)都不能为0,你这里肯定有一个是0,于是就有这个提示了。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式