Message Boards Message Boards

0
|
3115 Views
|
6 Replies
|
3 Total Likes
View groups...
Share
Share this post:

Unexpected matrix multiplication results?

Posted 2 years ago

If we multiply any matrix with any identity matrix means, if functioning wrongly. I'm checking it by manually, I got some other answer, but Wolfram shows wrong answer. It's a simple 2*2 matrix multiplication. But it works wrongly....

POSTED BY: Gugan S
6 Replies

The Dot operator is for vector and matrix multiplication. Multiplication is an element by element operation. For example:

In[61]:= {a, b, c} . {x, y, z}

Out[61]= a x + b y + c z

In[62]:= {a, b, c} * {x, y, z}

Out[62]= {a x, b y, c z}

The more general form of Dot is Inner (Dot is Inner using multiplication and addition as arguments). One way to think of it is that multiplication treats the operands as lists while Dot treats them as vectors and matrices.

Regards,

Neil

POSTED BY: Neil Singer

Welcome to Wolfram Community! Please make sure you know the rules: https://wolfr.am/READ-1ST Your post is too vague. Please describe your subject extensively providing the details, examples, and other relevant ideas, so it is clear what exactly you are looking for.

POSTED BY: Moderation Team
POSTED BY: Gugan S

My guess that you used multiply instead of Dot (which is an inner product).

In[11]:= ii = IdentityMatrix[3];

In[10]:= m = {{2, 2, 3}, {4, 5, 6}, {1, 2, 3}}

In[17]:= ans = m . ii

Out[17]= {{2, 2, 3}, {4, 5, 6}, {1, 2, 3}}

Does this fix your discrepancy?

Regards

POSTED BY: Neil Singer

Ohh thank you so much sir....because i used * (asterik) symbol for matrix multiplication. Right now i noticed from your reply, i checked this, its working perfectly. Thank you so much sir.

POSTED BY: Gugan S
Posted 2 years ago

Sir if you dont mind, please can you explain where we use asterik (*) and dot (.) for multiplication?

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

Group Abstract Group Abstract