MathGroup Archive 1996

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

Search the Archive

Re: ???? How to assign result from Solve to variable ????


In article <4let71$e4m at dragonfly.wolfram.com> rpiyaket at ucsd.edu (Ram Piyaket) writes:
>From: rpiyaket at ucsd.edu (Ram Piyaket)
To: mathgroup at smc.vnet.net
>Subject: ???? How to assign result from Solve to variable ????
>Date: 22 Apr 1996 03:08:17 GMT

>Hi,
>I was wondering if anyone could tell me how to deal with this problem.
>I want to assign the numerical result that I obtain from the Solve or etc. 
>command, which typically enclosed in the braces ({...}) to a variable
>so that I can reuse it. I just want the numerical number, not the braces.
>Can you tell me how? I appreciate all the help from you. Thank you very much.

>Ram

I presume you want something like this:

In[1]:=

   Solve[3 x == 5,x]
Out[1]:=

{x->1.6667}

In[2]:=

y = x/.First[[%1]]  **This tells Mma to assign the first result of input 1to **

Out[2]:=

1.6667


Hope this helps,


Lars

==== [MESSAGE SEPARATOR] ====


  • Prev by Date: Re: Help on Function
  • Next by Date: TeX output form of Mathematica ; line length problems .
  • Previous by thread: Re: ???? How to assign result from Solve to variable ????
  • Next by thread: Re: ???? How to assign result from Solve to variable ????