- ©«¤l
- 5923
- ¥DÃD
- 13
- ºëµØ
- 1
- ¿n¤À
- 5986
- ÂI¦W
- 0
- §@·~¨t²Î
- win10
- ³nÅ骩¥»
- Office 2010
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW°ò¶©
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2022-1-23
|
¥»©«³Ì«á¥Ñ GBKEE ©ó 2014-4-13 19:32 ½s¿è
¦^´_ 5# 518587 - Option Explicit
- Sub Ex()
- Dim Rng(1 To 2) As Range, i As Integer
- Dim f(1 To 7), Xik(1 To 7)
- Dim ii As Integer
- On Error Resume Next 'µ{¦¡½X¦³¿ù»~®É Ä~Äò¤U¤@¦æµ{¦¡½X(¤£²z·|)
- With ActiveSheet '«ü©w¤u§@ªí
- .Range("D:k") = ""
- .Range("b:b").Cells.Replace 1, "=aaa", lookat:=xlWhole '½d³ò¤¤ªºÀx¦s®æÈ = 1, קאּ¤£¦s¦bªº¤½¦¡,³y¦¨¿ù»~È
- Set Rng(1) = .Range("b:b").SpecialCells(xlCellTypeFormulas, xlErrors) '³]©wÅܼƬ°³o½d³ò¤¤¦³¿ù»~Ȫº¯S®íÀx¦s®æ
- Rng(1).Value = 1 '¯S®íÀx¦s®æªºÈ«ì´_ = 1
- End With
- With Rng(1)
- For i = 1 To .Areas.Count 'Areas ÄÝ©Ê ¶Ç¦^ Areas ¶°¦X¡A¦¹¶°¦X¥Nªí¦h«½d³ò¤¤ªº©Ò¦³½d³ò
- With .Areas(i).Cells(1, 2).Resize(7) '¤@¶g¦¸¼Æ¶q½d³ò
- '.Cells(1,2) 'DÄæ ** 1.¥ýpºâ©P¤@¨ì©P¤Cªº¥§¡¼Æ = AvgOld
- .Cells(1, 2) = Application.Average(.Cells)
- 'AvgOld
- A:
- '.Cells(1,3) 'EÄæ ** 2.±N 쥻¼Æ¶q ´î±¼AvgOld=Xik ¥[¤Wµ´¹ïÈ(¥X²{¤CÓ¼Æ)
- For ii = 1 To 7 '.Cells(ii, 1) CÄæ: 쥻¼Æ¶q
- '.Cells(1,7) 'IÄæ ** 6.ck=(-(Dpk^2)/ln(Ri)) (¥X²{¤@Ó¼Æ)
- .Cells(ii, 3) = Abs(.Cells(ii, 1) - .Cells(1, 2))
- 'Xik
- Xik(ii) = .Cells(ii, 3) '
- Next
-
- '.Cells(1,4) 'FÄæ ** 3.§ä¥X¶g¤@¨ì©P¤C³Ì¤jÈ´î±¼AvgOld=Dpk (¥X²{¤@Ó¼Æ)
- .Cells(1, 4) = Application.Max(.Cells) - .Cells(1, 2)
- 'Dpk
-
- '.Cells(1,5) 'GÄæ ** 4.§ä¥X¶g¤@¨ì©P¤C³Ì¤pÈ´î±¼AvgOld=Dnk (µ´¹ïÈ) (¥X²{¤@Ó¼Æ)
- .Cells(1, 5) = Abs(Application.Min(.Cells) - .Cells(1, 2))
- 'Dnk
-
- '.Cells(1,6) 'HÄæ ** 5.Dnk/Dpk=Ri (¥X²{¤@Ó¼Æ)
- .Cells(1, 6) = .Cells(1, 5) / .Cells(1, 4)
- 'Ri
-
- '*** ¨ì A578 ®É H578 = 1 Ln(.Cells(1, 6))=0
- '*** ¤À¥À=0 ¤£¥i°£ ªº¿ù»~ ***************
- '*** ±µ¤Uªº¼Æ¦r·|¦³¿ù»~ ***************
- '.Cells(1,7) 'IÄæ ** 6.ck=(-(Dpk^2)/ln(Ri)) (¥X²{¤@Ó¼Æ)
- .Cells(1, 7) = -(.Cells(1, 4) ^ 2) / Application.Ln(.Cells(1, 6))
- 'ck
-
- '.Cells(1,8) 'JÄæ ** 7.f=exp(-(Xik^2)/ck) (¥X²{¤CÓ¼Æ)
- For ii = 1 To 7
- .Cells(ii, 8) = Application.Evaluate("Exp(" & -(Xik(ii) ^ 2) / .Cells(1, 7) & ")")
- 'f
- 'VBA ¤£¤ä´© ¤u§@ªí¨ç¼Æ Exp
- 'Evaluate ¤èªk ±N Microsoft Excel ¦WºÙÂà´«¦¨ª«¥ó©ÎªÌÈ¡C
- f(ii) = .Cells(ii, 8)
- Next
-
- '.Cells(1,9) KÄæ ** 8.W=f/fªº¥[Á` (¥X²{¤CÓ¼Æ)
- For ii = 1 To 7
- .Cells(ii, 9) = f(ii) / Application.Sum(f)
- 'W
- Next
- '.Cells(1,10) LÄæ ** 9.AvgNew=SUMPRODUCT(W*ì©l¼Æ¶q) (¥X²{¤@Ó¼Æ)
- Set Rng(2) = .Cells(1, 9).Resize(7) 'W ªº½d³ò
- .Cells(1, 10) = Application.SumProduct(Rng(2), .Cells) 'AvgNew
- '10.¦pªG AvgOld-AvgNew>0.1 (¥[¤Wµ´¹ïÈ)ªº¸Ü ¡A·sªº¥§¡È´N¥²¶·¨ú¥Nªº¡AµM«á¦^¨ì²Ä¤G¨B«½Æpºâ¨ì¤p©ó0.1
- 'If Abs(.Cells(1, 2) - .Cells(1, 9)) > 0.1 Then GoTo A: '¦^¨ì²Ä2¨BÆJ
- '*********?????????????????????
- 'µM«á¦^¨ì²Ä¤G¨B«½Æpºâ¨ì¤p©ó0.1
- '¦p¦ópºâ¨ì¤p©ó0.1??
- '*******************************
- End With
- Next
- End With
- End Sub
½Æ»s¥N½X |
|