在法规中替换字符串 [英] Replace string in statment

查看:89
本文介绍了在法规中替换字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下午好。

我做一个计算器女巫想要通过使用Rihman总和找到积分值并找到区域

我做f(x)并想找到值f(x)在每个X = xi

所以我需要用值(xi)替换X并找到结果

我用

Good afternoon
I make a calculator witch want to find integration value by use Rihman sum and find area
I make f(x) and want to find value of f(x) in each X=xi
so i need to replace X with value (xi) and find the result
I use

dim T as string
t = textbox1.text
t.replace("X",1)





但我有错误

例如

F(x)= 5 * Sin(X)

想找到1-2

之间的区域我们分割提交[1-2]到10

循环

而i< = 2则

区域=区域+ F(i)

我有问题需要更换

我能做什么?





我使用VBProvider编译等式(作为字符串)找到结果

我用:CodeDom.Compiler.CompilerParameters

这个找到任何字符串的值,比如

Sin(1)* 3-4

但要查找 [a,b] ,我将提交到1000000提交(dx)



but I have error
for example
F(x)= 5*Sin(X)
and want to find area between 1-2
we divided filed [1-2] to 10
make a loop
while i<=2 then
Area = Area + F(i)
I have problem in replace
what I can do ?


I use VBProvider to compile the equation (as string) to find result
I use :CodeDom.Compiler.CompilerParameters
this find a value of any string like
Sin(1)*3-4
but to find a result of integration between [a,b] , I devided filed into 1000000 filed (dx)

while dx = [a-b]/n<br />





找到积分值我们在Xi中找到f(x)的值然后找到dA = F(Xi)* dx

然后找到A = Sum(dA)

这个方法叫做Rihman sum

现在我做一个循环找到一个F(Xi)的值,其中Xi在[a,b]之间

我有一个等式作为字符串(对于例如:F(x)= 3 * Sin(x))

我想计算[1,2]之间的积分,所以当
$ b $时我必须找到F(x)值b X = 1

X = 1.1

X = ..

X = 1.9

X = 2

并找到A = Sum(dA)= Sum(F(Xi))* dX

所以我需要一个循环替换X及其值(1,1.1,1, 2,....,1.9,2)

我希望你理解我的微笑| :)



find value of integration we find value of f(x) in Xi then find dA=F(Xi)*dx
then find A = Sum(dA)
this method called Rihman sum
Now I make a loop find a value of F(Xi) where Xi between [a,b]
I have an equation as string (for example : F(x) = 3*Sin(x) )
I want to calculate integration between [1,2] so I must find F(x) value when
X=1
X=1.1
X=..
X=1.9
X=2
and find A=Sum(dA) = Sum (F(Xi))*dX
so I need a loop replace X with its value (1,1.1,1,2,....,1.9,2)
I wish you understand me Smile | :)

推荐答案

如果你想评估表达式,请访问: .NET的计算引擎 [ ^ ]。在文章的底部,您将找到其他有用文章的链接。
If you want to evaluate expressions, please visit this: A Calculation Engine for .NET[^]. At the bottom of the article you'll find links to the other useful articles.


这篇关于在法规中替换字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆