title: Can someone explain this example of deleting elements from a matrix in MATLAB?
body: <p>The following example appears in the MATLAB tutorial:</p>
  
  <pre><code>X = [16  2 13;
       5  11  8;
       9   7 12;
       4  14  1]
  </code></pre>
  
  <p>Using a single subscript deletes a single element, or sequence of elements, and reshapes the remaining elements into a row vector. So:</p>
  
  <pre><code>X(2:2:10) = []
  </code></pre>
  
  <p>results in:</p>
  
  <pre><code>X = [16 9 2 7 13 12 1]
  </code></pre>
  
  <p>Mysteriously, the entire 2nd row and the first two elements in the 4th row have been deleted, but I can't see the correspondence between the position of the deleted elements and the index vector <code>2:2:10</code>. Can someone please explain?</p>