title: Matlab multiply matrix with matrix along third dimension
body: <p>I have a matrix <code>A</code> of size <code>m x n x 3</code> and I have have a <code>3x3</code> matrix <code>K</code>. Now what I want to do is something like this:</p>
  
  <pre><code>for row = 1:m
   for col = 1:n
    A(row,col,:) = K*[A(row,col,1);A(row,col,2);A(row,col,3)];
   end
  end
  </code></pre>
  
  <p>I'd like to have an efficient solution without a loop, as loops are very slow, because <code>m x n</code> is usually the size of an image.</p>
  
  <p>Anyone got an idea?</p>