title: matlab confusion matrix
body: <p>I have a small problem in coding confusion 3x3 matrix by using matlab...</p>
  
  <p>I tried the code below, </p>
  
  <pre><code>average = sum(diag(Mconf)./sum(Mconf,2))/3;
  </code></pre>
  
  <p>However, it get NaN for the confusion matrix is [0 0 0;1 2 3;4 5 6] or [1 2 3;0 0 0;4 5 6] or [1 2 3;4 5 6;0 0 0]</p>