Re: ?
- To: mathgroup at smc.vnet.net
- Subject: [mg120800] Re: ?
- From: Richard Hofler <rhofler at bus.ucf.edu>
- Date: Thu, 11 Aug 2011 05:10:27 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201108101047.GAA26230@smc.vnet.net>
Hi Dave,
In two steps:
In[2]:= FindRoot[Sin[x]+Exp[x],{x,0}]
%/.{x->y_}->y
Out[2]= {x->-0.588533}
Out[3]= -0.588533
In one step:
In[4]:= FindRoot[Sin[x]+Exp[x],{x,0}]/.{x->y_}->y
Out[4]= -0.588533
I hope this helps.
Richard Hofler
-----Original Message-----
From: David Kirkby [mailto:david.kirkby at onetel.net]
Sent: Wednesday, August 10, 2011 6:47 AM
To: mathgroup at smc.vnet.net
Subject: [mg120800] ?
The output of FindRoot[] when trying to find a root is like:
{x -> 0.49454545}
How can I convert that list, into the number 0.49454545?
In[1]:= FindRoot[x+9,{x,-5}]
Out[1]= {x -> -9.}
In[2]:= Head[%]
Out[2]= List
I can't seem to find any "normal" operations on the list which give me the =
number.
Dave
- References:
- How do I get a numeric value from FindRoot[] ?
- From: David Kirkby <david.kirkby@onetel.net>
- How do I get a numeric value from FindRoot[] ?