title: For R Markdown, How do I display a matrix from R variable
body: <p>I have a rmd document where I have the following</p>
  
  <pre><code>```{r code_block, echo=FALSE}
  A = matrix(c(1,3,0,1),2,2)
  B = matrix(c(5,3,1,4),2,2)
  ```
  
  $$
  \begin{bmatrix} 
  1  &amp; 0 \\ 
  3 &amp; 1 \\ 
  \end{bmatrix}
  *
  \begin{bmatrix} 
  5 &amp; 1 \\ 
  3 &amp; 4 \\ 
  \end{bmatrix}
  $$
  </code></pre>
  
  <p>Now I would like to instead of hard coding the LaTeX part manually, I could use the matrix from the variables A and B instead. How could this  be done?</p>
  
  <p>Thanks.</p>