Re: Matrix manipulation
- To: mathgroup@smc.vnet.net
- Subject: [mg12402] Re: Matrix manipulation
- From: "Allan Hayes" <hay@haystack.demon.cc.uk>
- Date: Thu, 14 May 1998 11:15:11 -0400
- References: <6j5svv$i6g$16@dragonfly.wolfram.com>
Michael Chang <bt585@FreeNet.Carleton.CA> Subject: [mg12402] [mg12327] Matrix
manipulation Notes the following
In[1]:=
a={{1,2},{3,4}};
In[2]:=
b=a//MatrixForm
Out[2]//MatrixForm=
1 2
3 4
In[3]:=
Inverse[b]
Out[3]=
Inverse[1 2]
3 4
The reason for this is that the FullForm of b is
In[4]:=
FullForm[b]
Out[4]//FullForm=
MatrixForm[List[List[1, 2], List[3, 4]]]
So the FullForm of Inverse[b] is
In[5]:=
FullForm[Inverse[b]]
Out[5]//FullForm=
Inverse[MatrixForm[List[List[1, 2], List[3, 4]]]]
-- which shows that Inverse does not get at the matrix inside MatrixForm
**Two suggestions**
1) If we only want to see b formatted two-dimensionally then we can use
In[6]:=
(b=a)//MatrixForm
Out[6]//MatrixForm=
1 2
3 4
In[7]:=
Inverse[b]//MatrixForm
Out[7]//MatrixForm=
-2 1
3 1
- -(-)
2 2
2) Use TraditionalForm for output - matrices are formatted two
dimensionally in this.
--
Allan Hayes
Mathematica Training and Consulting
Leicester UK
http://www.haystack.demon.co.uk
hay@haystack.demon.co.uk
voice: +44 (0)116 271 4198
fax: +44(0)116 271 8642