How can I get one single product matrix? Please help!
Asked
Active
Viewed 1,928 times
1 Answers
4
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.
John Doty
- 13,712
- 1
- 22
- 42


MatrixFormis only for visualizing the results. Sayingc1 = List[{2, 9}, {7, 1}, {7, 8}]is very different than sayingc1 = List[{2, 9}, {7, 1}, {7, 8}] // MatrixForm. To fix the issue, don't useMatrixFormwhen making assignments, only use it for displaying results. – Jason B. Feb 26 '18 at 22:23c1 = 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– Jason B. Feb 26 '18 at 22:27