title: How to remove pre-allocation warning in this situation
body: <p>When plotting a set of figures using a for loop, for example:</p>
  
  <pre><code>for ei=1:length(E),
    hnds(ei) = plot(1:nP, avgR(ei,:), [clrStr(ei),'-'] ); 
  end 
  </code></pre>
  
  <p>There is a (the famous) warning in the code for the <strong>hnds(ei)</strong> variable: </p>
  
  <blockquote>
    <p>The variable hnds(ei) appears to change size on every loop iteration.
    Consider pre-allocating for speed.</p>
  </blockquote>
  
  <p>But when I try to pre-allocate the variable:</p>
  
  <pre><code>hnds = zeros(1,length(E));
  </code></pre>
  
  <p>there is another warning for this new line and in the details for pre-allocation it says:</p>
  
  <blockquote>
    <p>Suggested Action:  Avoid preallocating memory to a variable assigned to
    the output of another function.</p>
  </blockquote>
  
  <p>Is there any way to remove this warning, or should just ignore it?</p>