Re: Using % in ; separated commands
- To: mathgroup at smc.vnet.net
- Subject: [mg35901] Re: [mg35889] Using % in ; separated commands
- From: Tomas Garza <tgarza01 at prodigy.net.mx>
- Date: Wed, 7 Aug 2002 05:59:18 -0400 (EDT)
- References: <200208051002.GAA18136@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Look at the definition of "%" in the Help browser under Out. "%n or Out[n] is a global object that is assigned to be the value produced on the nth output line". If n is omitted, then it is taken to be the last result generated. You must therefore use % in a separate cell: In[1]:= Solve[Sin[a] == 0.4717*Sin[Pi/3 - a], a]; In[2]:= Last[a /. %] Out[2]= 0.31923906428734306 Tomas Garza Mexico City ----- Original Message ----- From: "Kaustubh Raghukumar" <kausmic at yahoo.com> To: mathgroup at smc.vnet.net Subject: [mg35901] [mg35889] Using % in ; separated commands > Hi, > I have been using Mathematica for basic stuff so far > and find myself lost on how to acheive the following: > > I need to extract the last numerical value of 'a' in > Solve ( without the 'a ->'), so I can use it > elsewhere, without having to type it in. Here is what > I wrote > > Solve[Sin[a]==0.4717 * Sin[(Pi/3)-a],a]; Last[a /. %] > > The problem is that the value in '%' is not the output > of Solve, but the whatever operation came before that! > Any help on how to extract the last numerical from > solve will be greatly appreciated. > > Thanks a lot, > Kaustubh > > > __________________________________________________ > Do You Yahoo!? > Yahoo! Health - Feel better, live better > http://health.yahoo.com >
- References:
- Using % in ; separated commands
- From: Kaustubh Raghukumar <kausmic@yahoo.com>
- Using % in ; separated commands