Group Abstract Group Abstract

Message Boards Message Boards

0
|
6K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

how to multiply a 3 x 2 matrix by a 2 x 1 (row x column)

Posted 10 years ago
a = {{2, 3}, {3, 4}, {1, 1}} // MatrixForm
    b = {2, 7} // MatrixForm
    a*b
    N[{a*b}]

Call me a newbie, but I could not get a single matrix result

Could not show a result or simplify to one matrix ? (always had two matrices in the result) any Ideas ?

POSTED BY: john massucci
Posted 10 years ago

Very common confusion that doesn't seem made clear enough from the documentation.

MatrixForm makes things look pretty but you then can't do any calculations with the result.

You can use () to let you do the assignments first and then you can pretty print the result.

And . does matrix or vector multiply while * does element by element multiply

(a = {{2, 3}, {3, 4}, {1, 1}}) // MatrixForm
(b = {2, 7}) // MatrixForm
(a.b) // MatrixForm

It is actually a little more complicated than this, but by the time you understand and need that you shouldn't need this.

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