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
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 questionThank you all. I'll give it a try
it's my term paper