title: Matlab: Why does this piece of code works (expected an error)
body: <p>I got these two vectors, with 9 elements each: </p>
  
  <pre><code>&gt;&gt; length(a)
  
  ans =
  
       9
  
  &gt;&gt; length(c)
  
  ans =
  
       9
  </code></pre>
  
  <p>And this code: </p>
  
  <pre><code>z=0;
  s=0;
  temp=0;
  for K = 1:length(c)
      temp=c(K)*a(K);
      z=prod(1-a(K+1:end));
      s=s+temp*z;
  end
  </code></pre>
  
  <p>The vector's a indexing is done via K itterator. I would expect that index would blow. Am i missing something here?</p>