Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*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 2004

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

Search the Archive

Re: matrix times a vector

  • To: mathgroup at smc.vnet.net
  • Subject: [mg49024] Re: [mg49002] matrix times a vector
  • From: Sseziwa Mukasa <mukasa at jeol.com>
  • Date: Tue, 29 Jun 2004 04:49:52 -0400 (EDT)
  • References: <200406280813.EAA04270@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

On Jun 28, 2004, at 4:13 AM, David Salomon 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}  ?
>
> 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?
>

Plus @@ MapThread[Times, {{{a, b}, {c, d}}, {x, y}}]

But because Mathematica treats {a,b} and {c,d} as vectors {a x+c y,b 
x+d y} is the result which is equivalent to your desired output 
assuming {a,b} and {c,d} can be treated as vectors.  Replacing 
{{a,b},{c,d}} and {x,y} in the above expression by your desired N 
element lists will work assuming the N element sublists can be treated 
as vectors.

Regards,

Ssezi


  • Prev by Date: Re: Trigonometric simplification - newbe question
  • Next by Date: Re: Union - simple question
  • Previous by thread: matrix times a vector
  • Next by thread: Re: matrix times a vector