Hi to all,

I'm solving some numerical analiyse problems in C#.
Is there any C# implemented function similar to eval() in Matlab?
So, user type the function that he wants to evaluate in text box, and
eval(String s, double x) evaluate value of that function with argument x.
For example, if user wants to evaluate function y=x*x+6*x+12+sin(90) for x=6,
eval("sin(x)+x*x+6*x+12", 6) returns double value of result of this function - 85.

I appreciate any kind of help.

You could have a look at 3 code snippets I wrote which together form a console calculator. It accepts variables and expressions defined with these variables. As an example I also implemented the the sqrt function to be used in expressions. I suppose it can easily be adapted to make an eval method for the kind of functions you want.
http://www.daniweb.com/code/snippet217185.html
http://www.daniweb.com/code/snippet217186.html
http://www.daniweb.com/code/snippet217187.html
Succes!

You could have a look at 3 code snippets I wrote which together form a console calculator. It accepts variables and expressions defined with these variables. As an example I also implemented the the sqrt function to be used in expressions. I suppose it can easily be adapted to make an eval method for the kind of functions you want.
http://www.daniweb.com/code/snippet217185.html
http://www.daniweb.com/code/snippet217186.html
http://www.daniweb.com/code/snippet217187.html
Succes!

Great!!!

Congratulations for this code, it's fantastic...this should help me very much...all I have to do is to add some math functions (sin, exp, cos...)...

thank you very much!