       Re: ?

• To: mathgroup at smc.vnet.net
• Subject: [mg120809] Re: ?
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Thu, 11 Aug 2011 05:12:08 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com

```On 8/10/11 at 6:47 AM, david.kirkby at onetel.net (David Kirkby) wrote:

>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:= FindRoot[x+9,{x,-5}]

>Out= {x -> -9.}

>Out= List

>I can't seem to find any "normal" operations on the list which give
>me the number.

The output from FindRoot is a list of replacement rules. When
there is a single replacement rule simply do

In:= sol = FindRoot[x + 9, {x, -5}];

In:= x /. sol

Out= -9.

When there is more than one replacement rule you will need to
specify which solution you want. For example using Solve

In:= sol = Solve[x^2 == 9, x];

In:= x /. sol[]

Out= -3

In:= x /. sol[]

Out= 3

```

• Prev by Date: Re: ?
• Next by Date: Re: Just another Mathematica "Gotcha"
• Previous by thread: Re: ?
• Next by thread: ListDensityPlot and Legend