1
$\begingroup$

This question already has an answer here:

How can I get one single product matrix? Please help!

enter image description here

Now: enter image description here

$\endgroup$

marked as duplicate by Carl Woll, Henrik Schumacher, Jason B., m_goldberg, anderstood Feb 27 '18 at 1:54

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.

  • $\begingroup$ The trouble is that MatrixForm is only for visualizing the results. Saying c1 = List[{2, 9}, {7, 1}, {7, 8}] is very different than saying c1 = List[{2, 9}, {7, 1}, {7, 8}] // MatrixForm. To fix the issue, don't use MatrixForm when making assignments, only use it for displaying results. $\endgroup$ – Jason B. Feb 26 '18 at 22:23
  • $\begingroup$ So if I want to multiply C1 and D1, what command should I use? $\endgroup$ – Aly S. Feb 26 '18 at 22:25
  • $\begingroup$ c1 = List[{2, 9}, {7, 1}, {7, 8}]; d1 = List[{4, 0, 9}, {1, 4, 5}]; result = d1.c1; (* now use MatrixForm to print the result *) MatrixForm @ result $\endgroup$ – Jason B. Feb 26 '18 at 22:27
  • $\begingroup$ I typed in the exact same thing, and still got the two matrices. Why is that? Thank you so much Jason! $\endgroup$ – Aly S. Feb 26 '18 at 22:33
3
$\begingroup$

MatrixForm wraps the matrix for display, preventing other operations from seeing it as a matrix. This is actually quite handy: you can display matrix calculations unevaluated. To allow them to proceed, just remove the wrapper:

c1.d1 /. MatrixForm -> Identity
(* {{17, 36, 63}, {29, 4, 68}, {36, 32, 103}} *)

Re-wrap the result in MatrixForm if you want it pretty.

$\endgroup$
  • $\begingroup$ Got it! Thank you John! $\endgroup$ – Aly S. Feb 26 '18 at 22:40

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