MathGroup Archive 2012

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

Search the Archive

Re: How do I assign the solution obtained by FindRoot to a variable?


On 23 Okt., 07:04, NS Lin <nansheng.... at gmail.com> wrote:
> I would like to store the root/solution obtained by the FindRoot[] function to a variable.  How can I do that?
>
> Thanks!
>
> NS

In[472]:= eq = x == Exp[-x]

Out[472]= x == E^(-x)

In[475]:= z = x /. FindRoot[eq, {x, 1}]

Out[475]= 0.5671432904097838

In[477]:= Exp[-z]

Out[477]= 0.5671432904097838

Regards,
Wolfgang



  • Prev by Date: Re: How do I assign the solution obtained by FindRoot to
  • Next by Date: Re: How do I assign the solution obtained by FindRoot to a variable?
  • Previous by thread: Re: How do I assign the solution obtained by FindRoot to a variable?
  • Next by thread: Re: How do I assign the solution obtained by FindRoot to a variable?