2
$\begingroup$

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

enter image description here

Now: enter image description here

$\endgroup$
4
  • $\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$ Commented Feb 26, 2018 at 22:23
  • $\begingroup$ So if I want to multiply C1 and D1, what command should I use? $\endgroup$ Commented Feb 26, 2018 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$ Commented Feb 26, 2018 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$ Commented Feb 26, 2018 at 22:33

1 Answer 1

4
$\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$
1
  • $\begingroup$ Got it! Thank you John! $\endgroup$ Commented Feb 26, 2018 at 22:40

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.