I want to pass an equation as a parameter in a program when called so I can evaluate it. My goal is to allow the equation from parameter to have a value plugged in to solve, but the value plugged is based on part of program. I also want equation to be adjustable, not hard coded by passing as parameter on program call. How can I do this?
Edit: I have tried passing it as a string in an parameter to be called.
Function("equation")
And then using define to make it a sub function in my program, then call it that way with a var passed. I can't get that to work however, I get an error: "variable undefined."
I think the issue is linking var passed to sub function to var in equation given. I also tried just passing equation, no quotes, but got similar error.