MathGroup Archive 1992

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

Search the Archive

Vector multiplication??

  • To: mathgroup at
  • Subject: Vector multiplication??
  • From: William M. MacDonald <mcdonald at>
  • Date: Tue, 8 Dec 92 15:45:56 -0500

The following was not sent to this group but may be of general  
interest so I am sending it.

To: "Katherine (Williams) Derbyshire" <kewms at>
Subject: Re: Vector multiplication??

Regarding A^2 where A is a vector.

There is a very powerful element-by-element processing built into  
Mathematica that makes it unnecessary to write explicit DO loops for  
many things. If A and B are vectors of the same length then
          1.     A^2 gives the list of the elements squared, A[i]^2;
          2.     A*B gives the list with elements A[i]*B[i]
          3.     A + B gives the list with elements A[i]+B[i];                     

          4.     A^B is the list with elements A[i]^B[i];
          5.     A/B is the list with elements A[i]/B[i].
Also if one defines
is the list

All this is very obvious to anyone who knows APL, so its just a  
matter of learning the language. 

  • Prev by Date: Mathematica and Q'Nial
  • Next by Date: need e-mail address for Ross Moore
  • Previous by thread: Vector multiplication??
  • Next by thread: Difference equations