title: Delete rows with 0 for specific columns in Matlab
body: <p>So I want to delete rows of a matrix that contain zero, but only for specific columns. For example:</p>
  
  <pre><code>A = [[0 0 0 0; 1 2 0 4; 2 0 1 1; 0 0 0 0; 1 2 3 4; 0 1 2 3];
  </code></pre>
  
  <p>I want for matrix A to check if the second and/or 4th columns contain zero's. If this is true: then delete the whole row. So the result should be:</p>
  
  <pre><code>A = [1 2 0 4; 1 2 3 4; 0 1 2 3];
  </code></pre>
  
  <p>I used this function:  </p>
  
  <pre><code>new_a = A(all(A,2),:) 
  </code></pre>
  
  <p>But I deleted all the rows containing zeros. </p>