math编程
我有一个函数f(x)=Sin(x)
。 我的代码会提示用户inputx
上限和下限,以及它会有的间隔数n
。 然后代码将x
的固定值分配到一列中,并将f(x)
的值分配到另一列中。 然后,它应该创build一个函数的graphics。 到目前为止,我有
Function y() 'function 1 on sheet 1' Dim a As Double Dim b As Double Dim n As Integer Dim X As Integer a = InputBox("Enter your value for a on the interval [a,b]") b = InputBox("Enter your value for b on the interval [a,b]") n = InputBox("Enter the number of intervals for the function") If (b <= a) Then b = InputBox("Enter a value for b that is greater than the value you entered for a") End If Do While (x >= a) Or (x <= b) y = Sin(x) Loop End Function
我遇到的麻烦是创build列。 我不知道如何使代码返回固定值到一个列和variables值在另一列。 任何帮助,将不胜感激!