MathGroup Archive 2000

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

Search the Archive

Re: vector multiplication

  • To: mathgroup at smc.vnet.net
  • Subject: [mg25536] Re: [mg25505] vector multiplication
  • From: "Mark Harder" <harderm at ucs.orst.edu>
  • Date: Sat, 7 Oct 2000 03:35:40 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Yannis,
    This is what Outer[f,{},{}] is for:

In[195]:=
list1 = {u, v, w};
list2 = {x, y, z};
matrx = Outer[Times, list1, list2]
diag = Table[matrx[[i, i]], {i, 3} ]

Out[197]=
{{u x, u y, u z},{v x, v y, v z},{w x, w y, w z}}

Out[198]=
{u x, v y, w z}

...in this case, I used f=Times[] to get the outer product of two lists.
-mark harder



-----Original Message-----
From: Yannis.Paraskevopoulos at ubsw.com <Yannis.Paraskevopoulos at ubsw.com>
To: mathgroup at smc.vnet.net
Subject: [mg25536] [mg25505] vector multiplication


>Hi there,
>
>Could you please help me with the following:
>
>Assume the v is a vector (1xk). I would like to calculate the v'v and
>then take all the diagonal elements.
>
>Thanks a lot in advance for your effort.
>
>yannis
>
>
>Visit our website at http://www.ubswarburg.com
>
>This message contains confidential information and is intended only
>for the individual named.  If you are not the named addressee you
>should not disseminate, distribute or copy this e-mail.  Please
>notify the sender immediately by e-mail if you have received this
>e-mail by mistake and delete this e-mail from your system.
>
>E-mail transmission cannot be guaranteed to be secure or error-free
>as information could be intercepted, corrupted, lost, destroyed,
>arrive late or incomplete, or contain viruses.  The sender therefore
>does not accept liability for any errors or omissions in the contents
>of this message which arise as a result of e-mail transmission.  If
>verification is required please request a hard-copy version.  This
>message is provided for informational purposes and should not be
>construed as a solicitation or offer to buy or sell any securities or
>related financial instruments.
>
>
>



  • Prev by Date: Re: problem with nonlinearfit
  • Next by Date: Re: Reading a file
  • Previous by thread: Re: vector multiplication
  • Next by thread: Syntax