Re: Utilizing the Result From Solve[]
- To: mathgroup at smc.vnet.net
- Subject: [mg64109] Re: [mg64099] Utilizing the Result From Solve[]
- From: "Maarten van der Burgt" <maarten.vanderburgt at icos.be>
- Date: Thu, 2 Feb 2006 00:04:52 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Shyam,
Your method is correct but you can do it a bit shorter:
sol =Solve[z+2==3,z]
z = z/.sol[[1]]
Hope this helps
Maarten
Shyam
Guthikonda To: mathgroup at smc.vnet.net
<shyamguth@gm cc:
ail.com> Subject: [mg64109] [mg64099] Utilizing the Result From Solve[]
01/02/2006
10:34
If I am solving a simple equation, such as: Solve[z+2 = = 3,z], this
returns {{z->1}}. How can I easily get the result, 1? Solve[] returns
the solution in rule form.
The current method I use to just get the result looks very ugly. Is
there an easier way to do this?
Here is my current method:
ReplaceAll[z, First[ First[ Solve[ z + 2 = = 3, z ]]]];
z = %;
Now I can use z as a normal variable.
Thanks!
_Shyam