[VB6 ] Function使用陣列問
麻煩各位
小弟在寫副程式要算其標準差
其數值存在下面的normal陣列裡....
Dim normal(22) as double
Function s(ByVal x As Double, y() As Double, ByVal n As Integer) As Double
Dim sumS, ss As Double
sumS = 0
For i = 1 To n
sumS = sumS + y(i) ^ 2
Next i
ss = sqr((sumS - n * x ^ 2) / n - 1)
End Function
sN = s(avgN, normal, count1)
^^^^^^
執行錯誤:
『必須是陣列或是自訂型態』
(avgN為平均數、count1為陣列內數字個數)
爬文後還是不太懂要怎麼正確使用
麻煩各位了@@
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.116.96.104
※ 編輯: bamoo 來自: 140.116.96.104 (10/08 18:12)
※ 編輯: bamoo 來自: 140.116.96.104 (10/08 18:18)
※ 編輯: bamoo 來自: 140.116.96.104 (10/08 18:19)
→
10/08 21:09, , 1F
10/08 21:09, 1F
→
10/08 21:12, , 2F
10/08 21:12, 2F
→
10/08 21:13, , 3F
10/08 21:13, 3F