MathGroup Archive 2010

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

Search the Archive

Re: Silly question on Matrices

  • To: mathgroup at
  • Subject: [mg111557] Re: Silly question on Matrices
  • From: Bill Rowe <readnews at>
  • Date: Thu, 5 Aug 2010 06:59:40 -0400 (EDT)

On 8/4/10 at 5:50 AM, emammendes at (Eduardo M. A. M.Mendes)

>I am new to Mathematica.  In one of my attempts to understand how it
>works, I tried the following example

>A={{1,2,3},{4,5,6},{7,8,9}} //MatrixForm

>The result seems to be a matrix 3x3 but when I try A[[1][1]], the
>whole first line shows up instead of just one element.  If I don't
>use MatrixForm, it works fine.  How can I see a matrix in nice
>format without wrecking everything?

My recommendation is

Go to preferences. Select the evaluation tab. Then, use the menu
to set the format for new output cells to be TraditionalForm
from the menu. This will cause the display of all matrices to
have a pretty form that you like without the need for MatrixForm.

The problem with MatrixForm is that it does two things. It
causes the display to be what you want. But it also adds a
wrapper to the matrix being displayed. That is,

In[1]:= a = RandomInteger[10, {2, 2}]

Out[1]= {{5, 4}, {2, 5}}

In[2]:= MatrixQ[a]

Out[2]= True

In[3]:= b = MatrixForm[a];

Out[4]= False

MatrixForm will not change the way arguments supplied to it
evaluate. This is what is meant when the documentation says
MatrixForm does not effect evaluation. But the output of
MatrixForm is not a matrix and cannot be used as a matrix directly.

  • Prev by Date: Re: Silly question on Matrices
  • Next by Date: DiracComb and Fouriertransform
  • Previous by thread: Re: Silly question on Matrices
  • Next by thread: Plotting a parametric equation