Re: how to get rid of extra parentheses ?
- To: mathgroup at smc.vnet.net
- Subject: [mg92523] Re: how to get rid of extra parentheses ?
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Thu, 2 Oct 2008 18:48:10 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <gc2167$qa4$1@smc.vnet.net>
Obaid Rehman wrote:
> I am wondering if some one can help me in my issue.
>
> After some Algebraic manipulation I get the result but it is inside the
> two parenthesis e.g. {{........... }}. The problem is that Mathematica
> understand it as a list or matrix entry.
>
> If I need to use this result directly into the matrix manipulation it
> gives the error. Question is how to get rid these extra parentheses in
> the result that Mathematica add itself?
>
> e.g
>
> {{cb S V/ 2}}
Being clueless about what algebraic steps you followed and which
functions you used and/or programmed, it is hard to tell why you get the
result in the above form. Now, you can manipulate your result as any
other Mathematica expression, say by using the built-in function *Part*
(shortcut [[__]]). In your example, what you want is the first entry of
the first row, so [[1, 1]].
In[1]:= expr = {{cb S V/2}}
Out[1]= {{(cb S V)/2}}
In[2]:= expr[[1, 1]]
Out[2]= (cb S V)/2
The online documentation on *Part* contains numerous pointers to
additional information and tutorials about list and expression
manipulations. See
http://reference.wolfram.com/mathematica/ref/Part.html
HTH,
-- Jean-Marc