title: Matrix index out of range during loop
body: <p><code>a</code> is an <code>n</code>x<code>n</code> matrix.</p>
  <p>I have this code:</p>
  <pre><code>[m,n] = size(a);
  x = zeros(m,1);
  for j=1:1:n
      if(j==1)
      a(1,:) = [];
      else
      
      end
      disp(a);
      a(:,j) = [];
      
      disp(x);
      disp(a);      
  end
  </code></pre>
  <p>And it gives error on the line <code>a(:,j) = [];</code> which says</p>
  <blockquote>
  <p>Matrix index is out of range for deletion.</p>
  </blockquote>
  <p>Why? I dont understand, help appreciated.</p>