How to extract a solution from Mathematica's answer to "Solve"
- To: mathgroup at smc.vnet.net
- Subject: [mg49363] How to extract a solution from Mathematica's answer to "Solve"
- From: wilhelm.rainer at gmx.net (Rainer)
- Date: Fri, 16 Jul 2004 06:06:44 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
I have a question concerning the Solve command. Assume I have solved
an equation using Solve. Mathematica returns the solutions in the
following form (example for 2 solutions):
{{x->-2}, {x->2}}
Now, assume I wish always to pick the first of these two solutions and
store it in a variable (to be able to continue working with it in the
Notebook). Is there a command to "extract" the second solution and to
store it in a variable. Since the response is in a form of a matrix
{{...},{...}}, I have tried things like MySolution = %[[1]], but it
always fails.
I appreciate any helpful commands!
Thanks
Rainer