Say I have variables $x and $y. If I want to do something to $x to get $y, I go (for example):
$x=7; $y=3*$x**3 - 2*$x + 4;
This is fairly straighforward, but if I want to change the operations I perform on $x, I have to actually change the code. Is there some way I can store "3*$x**3 - 2*$x + 4" in a string and then use that string as my expression?
Thanks in advance for any help.
In reply to Recover a mathematical expression from a string. by misho
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |