title: Vectorization of a Sum over 3D array Matlab
body: <p>I'd like to know how to vectorize in MATLAB this code so as to avoid the use of loops :</p>
  
  <pre><code>for i=1:n1
  for j=1:n2
  A(i,j) = sum(B(:,i,j).*C(:,i,j));
  end
  end
  </code></pre>
  
  <p>where A are a matrix of size n1*n2 and B,C are 3D arrays.</p>
  
  <p>Thank you.</p>