MathGroup Archive 2010

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

Search the Archive

Re: Row or column?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112700] Re: Row or column?
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Mon, 27 Sep 2010 05:48:09 -0400 (EDT)

The one-dimensional list {a,b} is not what you should call a matrix:

   Length@Dimensions[{a, b}]
1

But { {a,b} } is properly called a matrix, because:

   Length@Dimensions[{{a,b}}]
2

And

   MatrixForm[{{a, b}}]

will accordingly produce a display of a one-row matrix, as you wish.

The documentation for MatrixForm explicitly says that it "prints a 
single-level list in a column."

On 9/26/2010 2:44 AM, Sam Takoy wrote:
> Hi,
>
> How come
>
> {a, b} // MatrixForm
> {{a}, { b}} // MatrixForm
>
> produce identical outputs: columns?
>
> I would think that the first "matrix" is 1x2 and the second is 2x1.
>
> Alternatively, how do I produce a 1x2 matrix?
>
> Many thanks in advance,
>
> Sam
>

-- 
Murray Eisenberg                     murray at math.umass.edu
Mathematics & Statistics Dept.
Lederle Graduate Research Tower      phone 413 549-1020 (H)
University of Massachusetts                413 545-2859 (W)
710 North Pleasant Street            fax   413 545-1801
Amherst, MA 01003-9305


  • Prev by Date: Re: How do I test for existence of a list element?
  • Next by Date: Re: How do I test for existence of a list element? Clarified
  • Previous by thread: Re: Row or column?
  • Next by thread: Re: Row or column?