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: 6   Last Post: Jun 19, 2013 1:20 AM

 Messages: [ Previous | Next ]
 David Bailey Posts: 714 Registered: 11/7/08
Re: Working with arrays
Posted: Jun 17, 2013 6:15 AM

On 16/06/2013 10:12, amannucci wrote:
> 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
>

In the first example, you used CenterDot, which is an operator with no
built in meaning. In the second case you used Dot, which will do
vector/matrix multiplication!

I must say, I never use these operators, because they can be confused
with each other, and a decimal point, and dots also mean repetition in
patterns!

David Bailey
http://www.dbaileyconsultancy.co.uk

Date Subject Author
6/16/13 amannuc1
6/17/13 Bill Rowe
6/17/13 David Bailey
6/17/13 amannuc1
6/19/13 David Bailey
6/17/13 Kevin J. McCann
6/17/13 Roland Franzius