ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ¦p¦ó§PÂ_¶g´Á°T¸¹?

[µo°Ý] ¦p¦ó§PÂ_¶g´Á°T¸¹?

§Ú¦³¤@²Õ¼Æ¦rfm1=32.2, fm2=44.3, fm3=63.0, fm4=79.1, fm5=95.2, fm6=111.3
§Ú¥H°}¦Cªº«¬¦¡±N¥¦¼g¤J¦¨
fm(0)=32.2
fm(1)=44.3
fm(2)=63.0
fm(3)=79.1
fm(4)=95.2
fm(5)=111.3
§Ú­n§PÂ_³o´X­Ó¼Æ¤§¶¡¬O§_¦³¤@©T©w¶g´Á(¶¡¹j),¨Ã±Æ°£¨ä¤¤­Ó§O¶g´Á ¨Ò¦p:
fm(1)-fm(0)=12.1
fm(2)-fm(1)=18.7
fm(3)-fm(2)=16.1
fm(4)-fm(3)=16.1
fm(5)-fm(4)=16.1
©Ò¥H©T©w¶g´Á(¶¡¹j)À³¬°16.1, ¦Ófm(1)=44.3³o­Ó¼ÆÅãµM¦³°¾®t¬G±N¥¦±Æ°£
¥H¤Wªº¨Ò¤lª½±µ¬Ý«Ü®e©ö§PÂ_ ¦ý¬O¸Ó¦p¦óÅý¦¨¬O¨Ó°µ§PÂ_©O?
½ÐªO¤Wªº°ª¤âµ¹­Ó«Øij ÁÂÁÂ

¦^´_ 1# acdx
¨Ò¤l©Ç©Çªº ­Y©T©w©P´Á16.1¡A«h fm(1) À³¬° 46.9¡Ffm(0) À³¬° 30.8
³o¼Ë¨â­Ó³£¦³°¾®t³£­n±Æ°£?

TOP

¦^´_ 2# stillfish00


­ì©l¼Æ¾Ú¬°¶q´úµ²ªG §Úªºµ{¦¡¬O¬°¤F¨ó§U¤ÀªR
©Ò¥H¦³¨Ç³\»~®t¬O¥i±µ¨üªº(+/- 1.5¥H¤º¥iµø¬°¬Û¦P) ¦ý¬O­n±Æ°£­Ó§OªºÂø°T

TOP

¦^´_ 3# acdx
  1. Sub nn()
  2. Dim Ar()
  3. k = 1.5 '®e³\»~®t
  4. fm = Array(32.2, 44.3, 63, 79.1, 95.2, 111.3) '±`¼Æ°}¦C
  5. Set d = CreateObject("Scripting.Dictionary")
  6. For i = 0 To UBound(fm)
  7. If i > 0 Then
  8. ReDim Preserve Ar(s)
  9. Ar(s) = fm(i) - fm(i - 1)
  10. s = s + 1
  11. End If
  12.    d(i) = fm(i)
  13. Next
  14. n = Application.Mode(Ar) '³Ì±`¥X²{®t­È
  15. For i = LBound(fm) + 1 To UBound(fm) - 1
  16.    If d(i) - d(i - 1) < n - k Or d(i + 1) - d(i) > n + k Then
  17.    d.Remove i
  18.    End If
  19. Next
  20. MsgBox Join(d.items, Chr(10))
  21. End Sub
½Æ»s¥N½X
¾Ç®üµL²P_¤£®¢¤U°Ý

TOP

¦^´_ 4# Hsieh
§Ú§Q¥Î n = Application.Mode(Ar) ¨Ó§PÂ_³Ì±`¥X²{ªº­È
­Y¬O¹J¨ì¾ã²Õ¼Æ¦rµL­«½Æªº­È(µL¶g´Á°T¸¹®É)µ{¦¡«h·|¥X²{error
³o¸Ó¦p¦ó­×¥¿©O?

TOP

¦^´_ 5# acdx
¥Î¦^Âkª½½uªº¤èªk±Æ°£®t²§¹L¤jªº­È¡A¬Ý¬Ý¬O§_¦³À°§U¡A
¶·ª`·N³o¸Ì¥Îªº¦^Âkª½½u¬O¥]§t°¾®t­Èªº¸ê®Æ©Ò±À¥Xªºª½½u¡A
©Ò¥HdeltaY­È½Ð¦Û¦æ·r°u
  1. Sub Test()
  2.     Dim d, fm
  3.     Dim a, b, it
  4.     Dim deltaY
  5.    
  6.     fm = Array(32.2, 44.3, 63, 79.1, 95.2, 111.3)
  7.     Set d = CreateObject("scripting.dictionary")
  8.     For i = 0 To UBound(fm)
  9.         d(i) = fm(i)
  10.     Next
  11.    
  12.     '¦^Âkª½½u  fm=ax+b
  13.     a = WorksheetFunction.Index(WorksheetFunction.LinEst(d.items, d.keys), 1)
  14.     b = WorksheetFunction.Index(WorksheetFunction.LinEst(d.items, d.keys), 2)
  15.    
  16.     deltaY = 1.5  '»P¦^Âk½uY¶b¤Wªº®e³\»~®t
  17.     For Each it In d.keys
  18.         '±Æ°£»~®t¹L¤jªº­È
  19.         If Abs((it * a + b) - d(it)) > deltaY Then d.Remove it
  20.     Next
  21.    
  22.     MsgBox Join(d.items, ",")
  23.     Set d = Nothing
  24. End Sub
½Æ»s¥N½X

TOP

¦^´_ 6# stillfish00
«á¨Ó§Ú§â¥¦§ï¦¨³o¼Ë¤]¥i¥H

Sub nn()
Dim Ar()
k = 1.5 '®e³\»~®t
fm = Array(32.2, 44.3, 63, 79.1, 95.2, 111.3) '±`¼Æ°}¦C
Set d = CreateObject("Scripting.Dictionary")
For i = 0 To UBound(fm)
If i > 0 Then
ReDim Preserve Ar(s)
Ar(s) = fm(i) - fm(i - 1)
s = s + 1
End If
   d(i) = fm(i)
Next
n = Application.Mode(Ar) '³Ì±`¥X²{®t­È
If IsNumeric(n) = False Then
    n = 0
    MsgBox "µL¶g´Á°T¸¹"
   Exit sub
End If
For i = LBound(fm) + 1 To UBound(fm) - 1
   If d(i) - d(i - 1) < n - k Or d(i + 1) - d(i) > n + k Then
   d.Remove i
   End If
Next
MsgBox Join(d.items, Chr(10))
End Sub

TOP

        ÀR«ä¦Û¦b : ¨C¤ÑµL©Ò¨Æ¨Æ¡A¬O¤H¥Íªº®ø¶OªÌ¡A¿n·¥¡B¦³¥Î¤~¬O¤H¥Íªº³Ð³yªÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD