MathGroup Archive 2002

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

Search the Archive

Re: Simple Concept I can't figure out! Making rules?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38132] Re: [mg38046] Simple Concept I can't figure out! Making rules?
  • From: Vladimir Bondarenko <vvb at mail.strace.net>
  • Date: Tue, 3 Dec 2002 04:34:16 -0500 (EST)
  • In-reply-to: <200211281907.OAA23937@smc.vnet.net>
  • References: <200211281907.OAA23937@smc.vnet.net>
  • Reply-to: Vladimir Bondarenko <vvb at mail.strace.net>
  • Sender: owner-wri-mathgroup at wolfram.com

snarten at runbox.com (Stan) wrote on Thursday, November 28, 2002, 3:07:35 PM :

S> here is my problem:

S> Lets say you solve an equation using "Solve"

S> Solve[2x - 1 == 0, x] // N

{{x ->> 0.5}}

S> How would I then use the result of "Solve" (0.5) and assign it to a
S> new variable, like "answer"  for further calculations?


Just use [[...]] (or its prefix equivalent, Part) to select a part of the
output you want to use for your further calculations.

  In[1] := answer = (Solve[2x - 1 == 0, x] // N)[[1, 1, 2]];

  In[2] := answer^2

  Out[2] = 0.25



Best wishes,

Vladimir Bondarenko
Mathematical and Production Director
Symbolic Testing Group

        http://www.CAS-testing.org/  GEMM Project             (95% ready)
        
Email:  vvb at mail.strace.net
Voice:  (380)-652-447325 Mon-Fri 6 a.m. - 3 p.m. GMT
ICQ  :  173050619
Mail :  76 Zalesskaya Str, Simferopol, Crimea, Ukraine




  • Prev by Date: Efficient Sorting Algorithm
  • Next by Date: Re: copying cells in Mathematica 4.2
  • Previous by thread: Re: Simple Concept I can't figure out! Making rules?
  • Next by thread: Re: Simple Concept I can't figure out! Making rules?