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

MathGroup Archive 2010

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

Search the Archive

Re: Row or column?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg112737] Re: Row or column?
  • From: Murray Eisenberg <murray at math.umass.edu>
  • Date: Wed, 29 Sep 2010 04:11:39 -0400 (EDT)

I don't see where the problem is -- provided you use a proper data 
structure for a matrix and don't confuse that with the display you get 
from MatrixForm.  For example, you get exactly the expected mathematical 
results from:

   a = {{2,3}};
   a.Transpose[a]
   Transpose[a].a

Note:

   {Dimsnsions[a], Dimensions@Transpose[a]}
{ {1,2}, {2,1} }


On 9/28/2010 6:02 AM, Kevin J. McCann wrote:
> This lack of distinction between rows and columns can be a problem.
> Consider:
>
> 	a.Transpose[a]     and     Transpose[a].a
>
> Kevin
>
> On 9/27/2010 5:48 AM, Sjoerd C. de Vries wrote:
>> Sam,
>>
>> Mathematica considers the first level of a list as rows, the second,
>> nested, levels are the columns etc. So, for display purposes {{a, b}}
>> would show as a row, but if you want to use it for matrix/vector
>> multiplication you only need {a,b}, as Mathematica does not
>> differentiate between row or column vectors.
>>
>> Cheers -- Sjoerd
>>
>> On Sep 26, 8:44 am, Sam Takoy<sam.ta... at yahoo.com>   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: Defining a function using common notation for absolutevalue (not Abs[x])
  • Next by Date: Re: SyntaxInformation and OptionsPattern
  • Previous by thread: Re: Row or column?
  • Next by thread: Independent Component Analysis? (here you go...)