C
C#2y ago
PepeGak

How to parse an expression that is a function

According to the assignment, the correct function is read into a string (For example, y=(sin(2*log(x)))^3+sqrt(1/x)), and the program will have to plot this function itself. How can I do that?
2 Replies
Brady Kelly
Brady Kelly2y ago
You would first have to develop an expression parser. What level of education is this assignment because it's massively complex. In Python or JS you could "cheat" and just pass the whole string, with some replacements, to the eval function. I suggest to change your post title to something like, "How to parse an expression that is a function", or something like that. I had no clue what you meant before opening your question
PepeGak
PepeGak2y ago
Thank you all. I'll give it a try it's my term paper