MathGroup Archive 1998

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

Search the Archive

Re: Matrix manipulation



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



  • Prev by Date: How does a rule get applied?
  • Next by Date: Re: Mathematica -> LaTeX
  • Prev by thread: Re: Matrix manipulation
  • Next by thread: [Fwd: How Mathematica select one of the roots?]