Group Abstract Group Abstract

Message Boards Message Boards

0
|
34.2K Views
|
5 Replies
|
1 Total Like
View groups...
Share
Share this post:

Multiply two matrices?

Posted 7 years ago

Hey folks! New kid on the block and working with matrices

I have two matrices: a = {{1, 4, -2}, {3, 5, 2}} b = {{6}, {-1}, {3}}

The second matrix should be a 3 row, 1 column. If I try to multiply the 2, I get an error :

Thread::tdlen: Objects of unequal length in {{1,4,-2},{3,5,2}} {{6},{-1},{3}} cannot be combined.

As I said, I'm new at this, matrix operations are still "magic" and I suspect I entered the 1 column matrix wrong...but, I don't see the error in my ways....

Can someone please show me what I did wrong?

The result should be a single column, 2 row with -4 and 19 as the elements...

Thanks in advance!

Tim

POSTED BY: Timothy Tapio
5 Replies
POSTED BY: Timothy Tapio
POSTED BY: Henrik Schachner

Did a bit of research....Mathematica apparently doesn't treat matricies in the same way our minds do....and therefore the "dot" operator is more appropriate.....

I have SO much to learn...

POSTED BY: Timothy Tapio

Why a "dot" function instead of multiplication?

Hate to sound stupid but how can it know that I actually needed a 1 column instead of the 3 columns as you listed? Or did I miss something?

I'm absolutely new to this, never had math beyond high school and that really didn't touch Calculus...and we didn't cover matrices either (high school class of 1972....we actually got to use a slide rule in my senior year).

I am totally amazed at what this software can do...and I haven't even begun to dig in...

Thanks!

Tim

POSTED BY: Timothy Tapio
Posted 7 years ago
a = {{1, 4, -2}, {3, 5, 2}};
b = {6, -1, 3};
a.b

gives

{-4, 19}

Mathematica can usually interpret a vector as either a row or a column as needed

POSTED BY: Bill Nelson
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard