Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

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

Search the Archive

Re: Silly question on Matrices

  • To: mathgroup at smc.vnet.net
  • Subject: [mg111547] Re: Silly question on Matrices
  • From: Peter Pein <petsie at dordos.net>
  • Date: Wed, 4 Aug 2010 07:44:26 -0400 (EDT)
  • References: <i3bd6b$pi8$1@smc.vnet.net>

Am Wed, 4 Aug 2010 09:51:07 +0000 (UTC)
schrieb "Eduardo M. A. M.Mendes" <emammendes at gmail.com>:

> Hello there
> 
> 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?
> 
> Many thanks
> 
> Ed
> 
> 

Do not assign MatrixForm[{{<matrix>}}] to a but {{<matrix>}} and throw
MatrixForm onto A:

In[11]:= (A={{1,2,3},{4,5,6},{7,8,9}})//MatrixForm
Out[11]//MatrixForm= 
(
1	2	3
4	5	6
7	8	9
)
In[12]:= A[[1,1]] (* A[[1][1]] is wrong *)
Out[12]= 1

hth,
Peter


  • Prev by Date: Re: How to require integer subscripts to match a simple pattern
  • Next by Date: Re: Can't get Mathematica to evaluate correctly a
  • Previous by thread: Re: Silly question on Matrices
  • Next by thread: Re: Silly question on Matrices