title: MATLAB: Multiplying elements of a cell array with another matrix to create a new cell array consisting of the products
body: <p>I have a cell array A consisting of a number of (2x1) matrices. 
  I have another matrix B (2x2) which I intend to multiply with each element of the cell A. In other words, every matrix within the array A has to be multiplied with B to generate another cell array C (same size as A) consisting of 2x1 matrices.</p>
  
  <p>Visually,</p>
  
  <pre><code>B*|A{1,1} A{1,2} ... A{1,n}| = |C{1,1} C{1,2} ... C{1,n}|
    |::::::::::::::::::::::::|   |::::::::::::::::::::::::|
    |A{m,1} A{m,2} ... A{m,n}|   |C{m,1} C{m,2} ... C{m,n}|
  </code></pre>
  
  <p>Here, C{i,j}=B*A{i,j}</p>
  
  <p>Doing this using <em>cellfun</em> is very slow. 
  <strong>Is there a way to vectorize this without using explicit loops and speed up the operation irrespective of the size of A and B (as long as they are multiply-able)?</strong></p>