Dim p(1 To 6) As Integer
Dim S(1 To 6, 1 To 6) As Integer
For i = 1 To 6
p(i) = Sheet1.Cells(1070, i)
Next i
For i = 1 To 6
For j = 1 To 6
S(i, j) = 0
For k = 1 To 1070
S(i, j) = S(i, j) + (Sheet1.Cells(k, i) - p(i)) * (Sheet1.Cells(k, j) - p(j))
Next k
S(i, j) = S(i, j) / 1069
Sheet2.Cells(i, j) = S(i, j)
If i <>j Then Sheet2.Cells(j, i) = S(i, j)
Next j
Next i
End Sub
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)