標題:
請教一個白痴問題求多項式系數 運算
[打印本頁]
作者:
jysun1
時間:
2018-8-27 13:47
標題:
請教一個白痴問題求多項式系數 運算
y=ax2+b+c
求下列 -b/2a VBA 要如何寫
y = 0.325x2 - 2.285x + 96.81
y = -0.4493x2 + 4.6159x + 79.479
y = -0.5191x2 + 4.9765x + 77.152
y = -0.3759x2 + 3.0353x + 80.458
y = -0.828x2 + 6.9143x + 71.517
y = -0.7489x2 + 5.9881x + 72.839
y = -0.6864x2 + 5.9984x + 69.456
y = -0.7438x2 + 6.3198x + 68.193
y = -0.9405x2 + 8.6403x + 60.431
y = -0.7646x2 + 7.1892x + 61.879
y = -0.5975x2 + 6.2365x + 61.215
感謝~
作者:
a5007185
時間:
2018-8-27 15:07
回復
1#
jysun1
請參考
Sub 計算(PT As Range)
Dim strMsg, a#, b#, c#
strMsg = Split(PT, " ")
a = Left(strMsg(2), Len(strMsg(2)) - 2)
b = Left(strMsg(4), Len(strMsg(4)) - 1)
If strMsg(3) = "-" Then b = -b
c = strMsg(6)
If strMsg(5) = "-" Then c = -c
'MsgBox a & Chr(10) & b & Chr(10) & c
PT.Offset(0, 1) = -b / (2 * a)
End Sub
複製代碼
[attach]29288[/attach]
作者:
jysun1
時間:
2018-8-27 22:28
回復
2#
a5007185
感謝大大,
搞定了!
謝謝您的回覆~
歡迎光臨 麻辣家族討論版版 (http://forum.twbts.com/)