Re: Lists: Row Vectors vs. Column Vectors. (feels like such a silly
- To: mathgroup at smc.vnet.net
- Subject: [mg110212] Re: Lists: Row Vectors vs. Column Vectors. (feels like such a silly
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Tue, 8 Jun 2010 07:08:53 -0400 (EDT)
On 6/7/10 at 8:08 AM, rgorka 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
>advil before I attempt to digest any answers. :)
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[4]}
Alternatively, something that displays as a column in MatrixForm is:
List/@Range[4]
But note:
In[4]:= MatrixQ /@ {{Range[4]}, List /@ Range[4]}
Out[4]= {True,True}
That is, both of these constructs are seen as matrices by
Mathematica and displayed appropriately by MatrixForm.
Also, notice
In[5]:= a = Range[4];
b = RandomInteger[1, {4, 4}];
In[8]:= b.a
Out[8]= {3,1,8,7}
In[9]:= a.b
Out[9]= {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.