MathGroup Archive 2005

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

Search the Archive

Re: refer to the result of FindRoot[ ]


perimeterbow at gmail.com wrote:
> FindRoot[] returns result in this format {x->2.123}, how can I get rid
> of the x-> so I can use the number directly to automate calculation
> flow?
> Thanks.
> 
*FindRoot* returns a list of transformation rules. You can use/apply 
them thanks to the replacement operator /. (forward slash and dot) as in 
the following example:

In[1]:=
FindRoot[x^2 + 5*x + 6 == 0, {x, 1}]

Out[1]=
{x -> -2.}

In[2]:=
x /. First[%]

Out[2]=
-2.

Check

http://documents.wolfram.com/mathematica/book/section-1.4.2

Regards,
/J.M.


  • Prev by Date: Re: Double integral of a piecewise-constant function
  • Next by Date: Re: refer to the result of FindRoot[ ]
  • Previous by thread: Re: refer to the result of FindRoot[ ]
  • Next by thread: Re: refer to the result of FindRoot[ ]