Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

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


  • Prev by Date: Re: Re: Sum of list elements
  • Next by Date: Re: definite integral
  • Previous by thread: Re: Re: DeleteCases : several at once, conditions
  • Next by thread: Re: How to extract a solution from Mathematica's answer to "Solve"