MathGroup Archive 2001

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

Search the Archive

Re: column * row ??


J.R. Chaffer <jrchaff at mcn.net> schrieb:
> Hi there,
> 
> Can someone tell me a way to mimic the building of
> an N x N matrix by multiplying a column vector
> on left times a row vector on right ? (both vectors
> of length N) - I mean in Mathematica, of course.
> 
> i.e, want the result,
> 
> (colvec){a1,a2, .. aN} * (rowvec){b1,b2,..bN} =
> 
> result is matrix:
> 
> {{a1*b1  a1*b2 .....  a1*bN},
>  {a2*b1  a2*b2 .....  a2*bN},
>   ...     ...          ...  ,
>  {aN*b1  aN*b2 .....  aN*bN}}
> 
John,
try Outer[Times, colvec, rowvec]


Gruß Peter
-- 
=--=--=--=--=--=--=--=--=--=--=--=--=--= http://home.t-online.de/home/phbrf
 Peter Breitfeld, Bad Saulgau, Germany   Meinen GnuPG/PGP-5x Key gibts dort



  • Prev by Date: RE: don't understand #
  • Next by Date: Re: Names[] for definitions in the current window/notebook?
  • Previous by thread: Re: RE: column * row ??
  • Next by thread: Re: column * row ??