Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Working with arrays
Replies: 4   Last Post: Jun 20, 2013 4:03 AM

 Messages: [ Previous | Next ]
 Tomas Garza Hernandez Posts: 264 Registered: 4/15/05
Re: Working with arrays
Posted: Jun 17, 2013 6:16 AM

Strange, indeed. I get the same result as you report. Yet,
In[7]:= Dot[lA, xtest]

Out[7]= {32, 77, 122}

as it should. Perhaps it has to do with the way one enters the dot. If you use an ordinary dot (not the center dot) from the keyboard it gives the right answer:
In[10]:= lA.xtest

Out[10]= {32, 77, 122}

-Tomas

> From: Anthony.J.Mannucci@jpl.nasa.gov
> Subject: Working with arrays
> To: mathgroup@smc.vnet.net
> Date: Sun, 16 Jun 2013 05:19:15 -0400
>
> I thought I understood variables. This sequence completely mystifies me:
> Clear[lA, xtest]
> lA = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
> xtest = {4, 5, 6};
> lA\[CenterDot]xtest (* First case *)
> {{a, b}, {c, d}} . {x, y} (* Second case *)
>
> The output is:
>
> {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}}\[CenterDot]{4, 5, 6}
>
> {a x + b y, c x + d y}
>
> How do I force matrix multiplication to actually occur, as in the second answer? Why does Mathematica do the matrix multiply in the second case but not the first?
>
> Thanks for any help.
>
> -Tony
>

Date Subject Author
6/17/13 Murray Eisenberg
6/17/13 Bob Hanlon
6/17/13 Tomas Garza Hernandez
6/20/13 collabe