title: Double dot product of two tensors
body: <p>I have two tensors: <code>A</code> is a second order tensor and <code>B</code> is a fourth order tensor. I know that when computing the <a href="http://en.wikipedia.org/wiki/Dyadics#Product_of_dyadic_and_dyadic" rel="nofollow">double dot product (:)</a> of two tensors, the rank of the resulting tensor will be decreased by two, so in my example the result should be a second order tensor.</p>
  
  <p>However, when I write this code in MATLAB, it gives the following error:</p>
  
  <blockquote>
    <p>Matrix dimensions must agree.</p>
  </blockquote>
  
  <p>How can I solve this problem?    </p>