title: MATLAB: How do I fix subscripted assignment dimension mismatch?
body: <p>new_img is ==> </p>
  
  <pre><code>new_img = zeros(height, width, 3); 
  </code></pre>
  
  <p>curMean is like this: <code>[double, double, double]</code></p>
  
  <pre><code>new_img(rows,cols,:) = curMean;
  </code></pre>
  
  <p>so what is wrong here?</p>