Re: Help: Column/Row Vector
- To: mathgroup at smc.vnet.net
- Subject: [mg4290] Re: Help: Column/Row Vector
- From: Harald Berndt <haraldb at nature.berkeley.edu>
- Date: Sat, 29 Jun 1996 03:55:22 -0400
- Organization: University of California Forest Products Lab
- Sender: owner-wri-mathgroup at wolfram.com
khinast at nld.chee.uh.edu wrote:
>
> Hi,
>
> I have two vectors x=(x1,x2) and y = (y1,y1). How can I persuade Mathematica
> that e.g. x is a column vector and y is a row vector, which is kind of
> important for their multiplication .
No, not really. Not in Mathematica, anyway. You just need to make sure
you use the right vector "product:" inner, outer, and (for lack of a
better word) direct. The latter is just an element-by-element
multiplication:
In[35]:=
{x1, x2} {y1, y2}
Out[35]=
{x1 y1, x2 y2}
The inner product is the usual scalar product or dot product of the
two vectors, regardless of order/orientation:
In[36]:=
{x1, x2}.{y1, y2}
Out[36]=
x1 y1 + x2 y2
In[37]:=
{y1, y2}.{x1, x2}
Out[37]=
x1 y1 + x2 y2
The outer, or tensor, product is the dyad of the two vectors, and
here, the order matters:
In[38]:=
Outer[ Times, {x1, x2}, {y1, y2} ]
Out[38]=
{{x1 y1, x1 y2}, {x2 y1, x2 y2}}
In[39]:=
Outer[ Times, {y1, y2}, {x1, x2} ]
Out[39]=
{{x1 y1, x2 y1}, {x1 y2, x2 y2}}
> I've studied the help page for hours, with no result. So could
> someone please help me. My email address is:
>
> khinast at nld.chee.uh.edu
>
> Joh.
I hope that helps a bit.
--
_______________________________________________________________
Harald Berndt University of California
Research Specialist Forest Products Laboratory
Phone: 510-215-4224 FAX:510-215-4299
_______________________________________________________________
==== [MESSAGE SEPARATOR] ====