Option Explicit
Public objMATLAB As Object
Private Sub Command1_Click()
Dim h1, h2 As String '定义高度
Dim l As String '定义频率
Dim d As String '定义距离
Dim calcity, x As String
h1 = Text1.Text
h2 = Text2.Text
calcity = "69.55 + 26.16 * (Log(1500) / Log(10)) - 13.82 * (Log(" & h1 & ") / Log(10)) + (44.9 - 6.55 * (Log(" & h1 & ") / Log(10))) * (Log(" & d & ") / Log(10)) - (1.1 * (Log(1500) / Log(10)) - 0.7) *" & h2 & "+ (1.56 * (Log(1500) / Log(10)) - 0.8)"
l = "fplot(@calcity,[0 30])"
Text3 = objMATLAB.execute(l)
End Sub
Private Sub Form4_initialize()
Set objMATLAB = CreateObject("matlab.application")
End Sub