>>Transpose[alpha].beta
but it dosen't work.
Please tell me how to do it.
Sorry for poor English.
Nobuhiko Tamura
@Chiba university
Japan
Email-> nta...@tky2.3web.ne.jp
Nabuhiko,
It looks as if you want to use, what traditionally would be written
(leaving out brackets)
like
a1 . (b1,b2,b3) = a1 b1, a1 b2, a1 b3 a2 a2
b1, a2 b2, a2 b3 a3 a3 b1, a3 b2, a3 b3
To get the same result with Mathematica we need
{{a1}, {a2}, {a3}}. {{b1, b2, b3}}
{{a1 b1, a1 b2, a1 b3}, {a2 b1, a2 b2, a2 b3}, {a3 b1, a3 b2, a3 b3}}
or
Transpose[{{a1, a2, a3}}].{{b1, b2, b3}}
{{a1 b1, a1 b2, a1 b3}, {a2 b1, a2 b2, a2 b3}, {a3 b1, a3 b2, a3 b3}}
*** In Mathematica a vector is simply a list like {a1,a2,a3} (and this
cannot be transposed)***.
To change it to a matrix form we can use
List[{a1, a2, a3}]
{{a1, a2, a3}}
giving a 1 by 3 matrix
or
List/@{a1, a2, a3}
{{a1}, {a2}, {a3}}
giving a 3 by 1 matrix
*** However, there is a way of getting the answer that you want directly
from vectors***:
Outer[Times, alpha, beta]
{{a1 b1, a1 b2, a1 b3}, {a2 b1, a2 b2, a2 b3}, {a3 b1, a3 b2, a3 b3}}
Allan,
---------------------
Allan Hayes
Mathematica Training and Consulting
www.haystack.demon.co.uk
h...@haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565
We must use actual matrices to distinguish row & column vectors:
The usual Mathematica method of using simple lists for vectors does
not distinguish between row and column vectors. Using this scheme, all
of these vectors are of the same type, and the Dot function returns
the sum of the products of corresponding elements.
If we wish t have row and colmn vectors, we are really talking about
matrices (or 2D tensors) in which there is either only one row or one
column.
So a row vector would be {{1,2,3}},
and its transpose is the column vector {{1},{2},{3}}.
In this case, the Dot function performs the normal matrix
multiplication, which is just what is desired!
Ronald D. Notestine
On Sabbatical for 1998/99 at:
Maths, Nottigham U., Nottingham NG7 2RD, UK tel: +44-(0)115-951-4938
email: gv...@pmn1.maths.nottingham.ac.uk
Permanent address (from late 1999, again) Ronald D. Notestine
Faculty of Management, Chukyo University 101-2 Yagoto-Honmachi,
Showa-ku, Nagoya 466-8666 tel: +81-(0)52-832-2151
email: ron...@mecl.chukyo-u.ac.jp
Use:
Transpose[ {alpha} ] . {beta}
If alpha is a "flat" list, then the transpose is just itself. When alpha
is a list of a one-list vector, then it transposes in the way you want
it.
Regards,
Nabil Fares
Imagineering LLC
NFa...@imagineeringLLC.com
http://www.imagineeringLLC.com/
> I have a problem about manupirating vectors. I wanted to make 3x3
> matrixtwo by using 3x1 vector alpha and beta. and I tried by
>
> >>Transpose[alpha].beta
>
> but it dosen't work.
> Please tell me how to do it.
>
> Sorry for poor English.
> Nobuhiko Tamura
> @Chiba university
> Japan
>
> Email-> nta...@tky2.3web.ne.jp
Hi, Nobuhiko Tamura
Let us suppose that
alpha={a,b,c}
beta={A,B,C}
then
Transpose[{alpha}] . {beta}
gives
{{aA, aB, aC},
{Ab, bB, bC},
{Ac, Bc, cC}}
alpha is just a vector but {alpha} is a matrix and you can apply
Transpose[].
Hope I understood your question right.
Anton
I suspect that the problem comes from the way you've defined the
matrices. For example, this defines two 3x1 matrices and displays them
as column vectors in MatrixForm:
a={{1},{2},{3}}; b={{2},{3},{4}};
a//MatrixForm
b//MatrixForm
Or you could use
a={{1,2,3}}//Transpose; b={{2,3,4}}//Transpose;
Now, enter
c=a.Transpose[b]
c//MatrixForm
to get the 3x3 product.
Nobuhiko Tamura wrote:
> I have a problem about manupirating vectors. I wanted to make 3x3
> matrixtwo by using 3x1 vector alpha and beta. and I tried by
>
> >>Transpose[alpha].beta
>
> but it dosen't work.
> Please tell me how to do it.
>
> Sorry for poor English.
> Nobuhiko Tamura
> @Chiba university
> Japan
>
> Email-> nta...@tky2.3web.ne.j
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dr. Selwyn Hollis
Associate Professor of Mathematics
Armstrong Atlantic State University
Savannah, GA 31419 USA
<http://www.math.armstrong.edu/faculty/hollis/>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* I have a problem about manupirating vectors. I wanted to make 3x3 *
matrixtwo by using 3x1 vector alpha and beta. and I tried by *
* >>Transpose[alpha].beta
*
* but it dosen't work.
* Please tell me how to do it.
*
* Sorry for poor English.
* Nobuhiko Tamura
* @Chiba university
* Japan
*
* Email-> nta...@tky2.3web.ne.jp
The following is one way to do this (the brackets are important):
rowVector={{a1,a2,a3}};
rowVector//MatrixForm
Transpose[rowVector]//MatrixForm
columnVector={{b1},{b2},{b3}};
columnVector//MatrixForm
Transpose[columnVector]//MatrixForm
dotProduct=rowVector.columnVector;
dotProduct//MatrixForm
outerProduct=columnVector.rowVector; outerProduct//MatrixForm
But, there are subtleties.
Jurgen
Nobuhiko Tamura wrote:
>
> I have a problem about manupirating vectors. I wanted to make 3x3
> matrixtwo by using 3x1 vector alpha and beta. and I tried by
>
> >>Transpose[alpha].beta
>
> but it dosen't work.
> Please tell me how to do it.
>
> Sorry for poor English.
> Nobuhiko Tamura
> @Chiba university
> Japan
>
> Email-> nta...@tky2.3web.ne.jp
If you want to use "Transpose" operation to "vectors", you should treat
it as 1x3 or 3x1 tensor. So you should write {{ a, b, c}} instead of
{a, b, c} as a representation of 3-dim vector (a, b, c). And you can
find the result of "Transpose[{{a, b, c}}]" will be {{a}, {b}, {c}} and
the operation "Transpose[{alpha}].{beta}" will work well as you've
wanted.
Try "{{a},{b},{c}}//MatrixForm" and "{{a, b, c}}//MatrixForm" on
Mathematica Ver.3 and you will get column and raw vector of (a, b, c).
Also, you can confirm the operation "Transpose[{{a, b, c}}].{{d, e,
f}}" is exactly same as palettes operation of (a, b, c)^t (d, e, f)
using "Hold" and "FullForm" functions.
A.ODA <a-...@muj.biglobe.ne.jp>
Kawasaki, JAPAN