The Math Forum



Search All of the Math Forum:

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


Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

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

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Bill Rowe

Posts: 1,647
Registered: 3/14/08
Re: Working with arrays
Posted: Jun 17, 2013 6:14 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 6/16/13 at 5:19 AM, Anthony.J.Mannucci@jpl.nasa.gov (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?


You seem to want Mathematica to treat two separate symbols (Dot,
CenterDot) as being the same out of the box. This simply isn't
how Mathematica is designed. CenterDot is used in Mathematica to
represent an action not something that performs an action.

It is possible to create definitions for CircleDot so that it
will behave as you appear to want using the Notations package.
But in my opinion, this isn't worth the effort required.





Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.