|
本帖最后由 神奇的VBA 于 2018-6-9 02:08 编辑
- Option Explicit '强制变量声明
- Option Base 1
- Sub com()
- Dim arr(1000, 14) As Variant
- Dim tmp As String
- Dim i As Long
- Dim j As Long
- Dim p As Double
- Open "C:\Users\YMX\Desktop\试验X.txt" For Input As #1
- Do While p <= 1.6
- Line Input #1, tmp
- i = i + 1
- For j = 1 To 12
- arr(i, j) = Split(tmp, ",")(j - 1)
- Next
- If i >= 2 Then
- p = arr(i, 1) + arr(i, 2) / 1000
- End If
- Loop
- MsgBox tmp '已导入数据到二维数组arr
- Dim m As Long
- Dim br()
- ReDim br(i)
- For m = 1 To i
- br(m) = arr(m, 1) '将二维数组数据导入一维数组br
- Next
- Debug.Print Application.StDev(br) '为什么计算不了br数组的标准差
- MsgBox br(200)
- MsgBox arr(1, 2)
- End Sub
复制代码
请问大神,为什么无法计算br的标准差?或者说我把数据导入arr数组(二维),怎么计算其中某列的标准差,求助
|
|