Re: MatrixForm odd behaviour

• To: mathgroup at smc.vnet.net
• Subject: [mg124497] Re: MatrixForm odd behaviour
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Sat, 21 Jan 2012 05:21:08 -0500 (EST)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com

```On 1/19/12 at 5:08 AM, roby.nowak at gmail.com (roby) wrote:

>As a similar Question is discussed on the group now.

>The following issue:

>When entering e.g.: Dot[MatrixForm[{{1, 0}, {0, 2}}],
>MatrixForm[{{1, 0}, {0, 2}}]] Mathematica does not evaluate the Dot
>operation and displays the two unchanged input matrices seperated by
>a "Dot" each respectively wrapped by MatrixForm, so far so good (or
>perhaps not so good).

The purpose of MatrixForm, TraditionalForm etc is to control the
display of an individual expression. This is accomplished in
Mathematica by changing the Head of an expression. That is:

In[6]:= a = MatrixForm[b = RandomReal[1, {5, 5}]];

Out[7]= {MatrixForm,List}

In[8]:= MatrixQ /@ {a, b}

Out[8]= {False,True}

So, since Mathematica sees the output of MatrixForm as not a
matrix it should be no surprise Mathematica won't evaluate MatrixForm[m].MatrixForm[m].

The simple way to have matrices and other expressions display
the way you see in text books is to set your preferences for
output cells to use TraditionalForm. Once this is done, all
matrices display nicely with no further effort on your part or
use of MatrixForm. And, since this sets the display on a global
basis rather than an expression by expression basis, there is no
need to change the expression to control the display.
Consequently, the issue with MatrixForm is eliminated.

```

• Prev by Date: Re: Daylight savings time in DatePlus.
• Next by Date: General advice on making slides that show examples
• Previous by thread: Re: MatrixForm odd behaviour
• Next by thread: Re: MatrixForm odd behaviour