Re: Matrix manipulation - Thanks!
- To: mathgroup@smc.vnet.net
- Subject: [mg12446] Re: Matrix manipulation - Thanks!
- From: bt585@FreeNet.Carleton.CA (Michael Chang)
- Date: Tue, 19 May 1998 13:31:17 -0400
- Organization: The National Capital FreeNet
- References: <6j5svv$i6g$16@dragonfly.wolfram.com> <6jf0de$3dl@smc.vnet.net>
Hi!
Thanks very much for *all* of your suggestions. Using the
TraditionalForm option as an output option seems to be a very simple
and effective solution!
Thanks again!
Mike
"Allan Hayes" (hay@haystack.demon.cc.uk) writes:
> Michael Chang <bt585@FreeNet.Carleton.CA> Subject: [mg12446] [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
>