Re: Problems with Solve
- To: mathgroup at smc.vnet.net
- Subject: [mg17032] Re: [mg17010] Problems with Solve
- From: Maarten.vanderBurgt at icos.be
- Date: Wed, 14 Apr 1999 02:11:49 -0400
- Sender: owner-wri-mathgroup at wolfram.com
Tanveer, You can use the ReplaceAll (/.) substitution command as in the example below. Here the two solutions of x^2 + a == b are stored in variables x1 and x2. In[1]:= sol = Solve[x^2 + a == b, x] Out[1]= {{x -> -Sqrt[-a + b]}, {x -> Sqrt[-a + b]}} In[2]:= x1 = x /. sol[[1]] x2 = x /. sol[[2]] Out[3]= -Sqrt[-a + b] Out[4]= Sqrt[-a + b] Maarten ___________________________________________________________________________ ____ Maarten van der Burgt R&D Department ICOS Vision Systems Esperantolaan 9 B-3001 Leuven Belgium tel. + 32 16 398220 direct + 32 16 398316 fax. + 32 16 400067 e-mail: maarten.vanderburgt at icos.be ___________________________________________________________________________ ____ Tanveer Choudhury <tanveer at wam.umd.edu> on 10-04-99 08:13:40 AM Subject: [mg17032] [mg17010] Problems with Solve I have an equation eqn == rhs Solving in the following way Solve[eqn,x] the output is something like x->2.11 how do I save the value for x to someother variable... u can mail to tanveer at wam.umd.edu thanx