MathGroup Archive 2000

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

Search the Archive

Re: How to add a vector to a list of vectors?


on 00.12.29 11:31 AM, AGUIRRE ESTIBALEZ Julian at mtpagesj at lg.ehu.es wrote:

> Dear Group,
> 
> I have a list of vectors l = {v1,...,vn} and another vector w, all
> of the same length. I wat to get the list {w + v1, ..., w + vn} .
> 
> l + w does not work.
> 
> Is there a simpler (or more efficient) way than
> 
> Table[w + l[[i]],{i, Length at l}] ?
> 
> Julian Aguirre
> Universidad del Pais Vasco
> 
> 
> 

As usual, there are lots of ways, but the first one that comes to my mind
is:

Transpose[Transpose[l] + w]


-- 
Andrzej Kozlowski
Toyama International University
JAPAN

http://platon.c.u-tokyo.ac.jp/andrzej/
http://sigma.tuins.ac.jp/



  • Prev by Date: Re: How to add a vector to a list of vectors?
  • Next by Date: Re: How to add a vector to a list of vectors?
  • Previous by thread: Re: How to add a vector to a list of vectors?
  • Next by thread: Re: How to add a vector to a list of vectors?