MathGroup Archive 1996

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

Search the Archive

Replacement Rule


Ram asked

>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.

Try using the Replacement Rule: /.

For Example:

Solve[x^2+3x+2==0];
{x1,x2}=x/.%;

You will find x1=-2, and x2=-1.

Regards,
John C. Erb




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


  • Prev by Date: Re: Muller's Method
  • Next by Date: Re: Function
  • Previous by thread: Re: Muller's Method
  • Next by thread: Re: Windows 95 Problems