我需要它从 -n 循环到 n ,但到目前为止这只产生一个坐标。有谁知道任何简单的快速修复,所以我可以将 -n 到 n(步骤 1)的值代入 y 方程 id 输入?
我也不确定我是否正确使用了表达式部分,因为我在今天之前从未尝试过 NCalc。
Dim y As String
Dim n As Integer
n = txtX.Text
y = txtY.Text
For x As Integer = -n To n Step 1
Dim exp As Expression = New Expression(y)
exp.Parameters("n") = n
Label1.Text = exp.Evaluate
Chart1.Series("plot1").Points.AddXY(x, y)
Next