Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: refer to the result of FindRoot[ ]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg61560] Re: refer to the result of FindRoot[ ]
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Sat, 22 Oct 2005 00:36:19 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <dja24u$fg7$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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[ ]