       Re: Lists: Row Vectors vs. Column Vectors. (feels like such a silly

• To: mathgroup at smc.vnet.net
• Subject: [mg110251] Re: Lists: Row Vectors vs. Column Vectors. (feels like such a silly
• From: Bill Rowe <readnews at sbcglobal.net>
• Date: Thu, 10 Jun 2010 08:08:59 -0400 (EDT)

```On 6/9/10 at 7:20 AM, rgorka at gmail.com (telefunkenvf14) wrote:

>On Jun 8, 6:08 am, Bill Rowe <readn... at sbcglobal.net> wrote:
>>On 6/7/10 at 8:08 AM, rgo... at gmail.com (telefunkenvf14) wrote:

>>>Can someone explain why a list does not display in MatrixForm as a
>>>row?---It's ok if the answer is computer sciency. I'll take some

>>Because a 1D list is not defined as either a row nor a column. An
>>example of something that displays as a row in MatrixForm would be

>>{Range}

>>Alternatively, something that displays as a column in MatrixForm is:

>>List/@Range

>>But note:

>>In:= MatrixQ /@ {{Range}, List /@ Range}

>>Out= {True,True}

>>That is, both of these constructs are seen as matrices by
>>Mathematica and displayed appropriately by MatrixForm.

>>Also, notice

>>In:= a = Range; b = RandomInteger[1, {4, 4}];

>>In:= b.a

>>Out= {3,1,8,7}

>>In:= a.b

>>Out= {10,5,3,7}

>>showing it is up to you to determine whether a 1D list should be
>>interpreted as a column vector or row vector.

>In:= vector=Range; MatrixForm[vector,TableDirections->Row]
>%//Dimensions

>Out//MatrixForm= (1 2   3   4   5)
>Out= {5}

>Now the same thing with TableDirections->Column:

>In:= vector=Range;
>xPrime=MatrixForm[vector,TableDirections->Column] %//Dimensions

>In:= vector=Range;
>xPrime=MatrixForm[vector,TableDirections->Column]
>%//Dimensions
>
>Out//MatrixForm=
>(
>1
>2
>3
>4
>5
>)
>Out= {5}

>What's confusing is that the displayed (standard form) output in the
>first case *looks like* a 1x5 matrix and the second case *looks
>like* a 5x1.

Right. That is the point of MatrixForm. It puts a wrapper around
the list and causes it to *display*  (look like) what you want.
But MatrixForm in no way makes the list a column or row vector.

While I also prefer the appearance of matrices displayed by
MatrixForm, I never use MatrixForm. Instead, I have my
preferences set to display output cells in TraditionalForm. That
way, something that displays as a 5 x 1 array is a 5 x 1 array.

```

• Prev by Date: Re: difficulty using FindRoot
• Next by Date: Re: Export
• Previous by thread: Re: Lists: Row Vectors vs. Column Vectors. (feels like such a silly
• Next by thread: Re: Lists: Row Vectors vs. Column Vectors. (feels like such a silly