0
$\begingroup$

This question already has an answer here:

I'm multiplying matrices and I don't get answer I want I just get matrix M times matrix N, there is no result. What to do and what to fix in order to get result displayed?

M = {{1, 3, 3}, {3, 4, 4}, {5, 5, 5}} // MatrixForm

Mathematica graphics

P = {{1, 2, 6}, {3, 6, 4}, {5, 9, 5}} // MatrixForm

Mathematica graphics

M.P

Mathematica graphics

$\endgroup$

marked as duplicate by Mr.Wizard Oct 23 '14 at 20:28

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    $\begingroup$ You need to include more detail of what you are doing. Possibly using Dot (short form .) will solve your problem if you have actual matrix data. The data might potentially need to be transposed. Also you can/should not use N as a variable as it is already a defined System function. $\endgroup$ – Mr.Wizard Oct 23 '14 at 20:11
  • $\begingroup$ Printscreen: postimg.org/image/qgo5cqz3t $\endgroup$ – VlS Oct 23 '14 at 20:15
  • 1
    $\begingroup$ @VladimirS, This is not a good way to share your code, see the edits I did for you. $\endgroup$ – rhermans Oct 23 '14 at 20:23
  • $\begingroup$ Oh, sorry. Thanks, I'll learn how to do that for my next question. $\endgroup$ – VlS Oct 23 '14 at 20:24
  • 1
    $\begingroup$ The problem is MatrixForm. See, detail is important. :-) I am closing this question as a duplicate. (A link will be inserted at the top of your post.) See the answers there fore a full explanation. $\endgroup$ – Mr.Wizard Oct 23 '14 at 20:28
2
$\begingroup$
M = {{1, 3, 3}, {3, 4, 4}, {5, 5, 5}}
{{1, 3, 3}, {3, 4, 4}, {5, 5, 5}}
P = {{1, 2, 6}, {3, 6, 4}, {5, 9, 5}}
{{1, 2, 6}, {3, 6, 4}, {5, 9, 5}}
M.P
{{25, 47, 33}, {35, 66, 54}, {45, 85, 75}}

Or, if you want the nice display be sure not to include that in the definition of your matrix

MatrixForm[M = {{1, 3, 3}, {3, 4, 4}, {5, 5, 5}}]

Mathematica graphics

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.