Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Re: How to transpose vector?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg14673] Re: How to transpose vector?
  • From: "Allan Hayes" <hay at haystack.demon.co.uk>
  • Date: Sun, 8 Nov 1998 21:15:33 -0500
  • References: <720th6$1vl@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Nobuhiko Tamura wrote in message <720th6$1vl at smc.vnet.net>...
>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-> ntamura at 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
hay at haystack.demon.co.uk
Voice: +44 (0)116 271 4198
Fax: +44 (0)870 164 0565




  • Prev by Date: RE
  • Next by Date: Multiplying large polynomials
  • Previous by thread: Re: How to transpose vector?
  • Next by thread: Re: How to transpose vector?