How to pass variable name to function in program
Publié : mer. janv. 11, 2023 1:40 am
I am trying to pass a variable name into a function to include in a command. I want a function that can, for example:
eq=3*x^2+x
int_test(eq,x)
such that it can integrate the equation stored in eq by x. yielding:
int(3*x^2+x,x)
i can't get it to stop doing this:
int(3^x^2+x,<the variable name in the program>)
Matt
eq=3*x^2+x
int_test(eq,x)
such that it can integrate the equation stored in eq by x. yielding:
int(3*x^2+x,x)
i can't get it to stop doing this:
int(3^x^2+x,<the variable name in the program>)
Matt