matlab - Do I have to clear variables each time I alter my loop index?
<pre><code>for ii=1:5    
a(ii) = (ii)^2;
end
a
</code></pre>

<p>Say, I alter the end value of loop index from 5 to 4, the answer given is still  [1     4     9    16    25]</p>

<p>Only if I 'clear all' , it gives        [  1     4     9    16 ]</p>

<p>Is this normal?</p>