Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Setting variable as answer to Solve' topicStudent Support Forum > General > "Setting variable as answer to Solve"

Next Comment >Help | Reply To Topic
Author Comment/Response
West
10/20/11 12:43pm

sol = Solve[{x + y == -6, x - y == 25}, {x, y}, Reals]
list = {x, y} /. sol
innerList = list[[1]]
x1 = innerList[[1]]
y1 = innerList[[2]]

So I'm basically looking for a simpler way to set x1 and y1 to the solution of Solve. It's fairly odd I need to pull them out of lists twice in order to have them set as just integers. Anybody know a better way to do this?

Thanks

URL: ,

Subject (listing for 'Setting variable as answer to Solve')
Author Date Posted
Setting variable as answer to Solve West 10/20/11 12:43pm
Re: Setting variable as answer to Solve qm2008q 11/24/11 10:53pm
Next Comment >Help | Reply To Topic