MathGroup Archive 2004

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

Search the Archive

Re: matrix times a vector


In article <cbokn1$4bl$1 at smc.vnet.net>,
 David Salomon <david.salomon at csun.edu> wrote:

> Question:
> 
> The input {{a,b}, {c,d}}.{x,y} generates the output {a x+b y,c 
> x+d y}. 
> 
> How can I get the output x{a,b}+y{c,d}  ? 

By direct multiplication (note that . has been deleted):

  {{a,b}, {c,d}} {x,y}
 
> This is a special case of lists with two elements. How 
> can I extend this computation in an elegant way to lists 
> with N elements?

This works with n elements:

  {{a, b, c}, {c, d, e}, {e, f, g}, {f, g, h}} {x, y, t, u}

Cheers,
Paul

-- 
Paul Abbott                                   Phone: +61 8 9380 2734
School of Physics, M013                         Fax: +61 8 9380 1014
The University of Western Australia      (CRICOS Provider No 00126G)         
35 Stirling Highway
Crawley WA 6009                      mailto:paul at physics.uwa.edu.au 
AUSTRALIA                            http://physics.uwa.edu.au/~paul


  • Prev by Date: Appropriate codec for playing Mathematica generated .wav files
  • Next by Date: Re: Pattern Matching
  • Previous by thread: RE: matrix times a vector
  • Next by thread: Re: matrix times a vector