title: Multiply each row of a matrix by another matrix
body: <p>Say I have the following matrix</p>
  
  <pre><code>B = [1 2 3;4 5 6;7 8 9;10 11 12]
  </code></pre>
  
  <p>and another matrix</p>
  
  <pre><code>A = [a b c;d e f;g h i]
  </code></pre>
  
  <p>How do I multiply each row of matrix B by the matrix A (without using a for loop), i.e.</p>
  
  <pre><code>for i = 1:4
      c(i) = B(i,:)*A*B(i,:)'
  end
  </code></pre>
  
  <p>many thanks in advance.</p>