MathGroup Archive 1999

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

Search the Archive

Re: Don't want to calculate scalar product


Toshiyuki (Toshi) Meshii <meshii at mech.fukui-u.ac.jp> schrieb:
> Hi,
> 
> I understand that one of the unique point of Mathematica is that you don't
> have to be conscious about whether a vector is a "row" or a "column" vector.
> 
> However, I think there is a case in which you have to specify whether you
> want Mathematica to recognize a vector as a row vector or a column vector.
> Let me explain my case.
> 
> a={1,2,3}; b={4,5,6}
> 
> I want to define "a" as a column vector (3x1 matrix) and "b" as a row vector
> (1x3 matrix).
> 
> I expect the product
>  a.b
> as a 3x3 matrix, but the answer Mathematica gives is a scalar product "32".
> 
Mathematica doesn't distiguish between row and column vectors. You have
to use Outer:

In[1]:=Outer[Times, a, b]
Out[1]={{4, 5, 6}, {8, 10, 12}, {12, 15, 18}}

 Peter
-- 
=--=--=--=--=--=--=--=--=--=--=--=--=  http://home.t-online.de/home/phbrf  =--=
=--= Peter Breitfeld, Saulgau, Germany        PGP public key: 08548045  =--=--=



  • Prev by Date: Re: direction field plots
  • Next by Date: Re: Manipulating a list of pairs
  • Previous by thread: Re: Don't want to calculate scalar product
  • Next by thread: Re: Don't want to calculate scalar product