# calling variable that holds a previous output.

Posted 9 years ago
4663 Views
|
3 Replies
|
2 Total Likes
|
 I have a equation system with two variables. And the Mathematica gives a solution.How can I call this solution a line down to do another calc.This question is for automatization process I'm doing.Solve[x + y == 2 && x - y == 1, {x, y}] {{x -> 3/2, y -> 1/2}}
3 Replies
Sort By:
Posted 9 years ago
 You're missing a semicolon sol = Solve[x + y == 2 && x - y == 1, {x, y}]; x = x /. Flatten[sol]; y = y /. Flatten[sol] Undo the symbol damage with Clear["x"];Clear["y"]; Re-execute and your answers will be OK.
Posted 9 years ago
 This is how I save itsol = Solve[x + y == 2 && x - y == 1, {x, y}]; x = x /. Flatten[sol] y = y /. Flatten[sol]It says is an error
Posted 9 years ago
 (* Original equation *) sol = Solve[x + y == 2 && x - y == 1, {x, y}] (* Use solution for another function of x and y *) x + 7 y /. Flatten[sol] 
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments