title: Get even/odd indices of a matrix - MATLAB
body: <p>I have following problem:</p>
  
  <p>I have a given matrix of let's say <code>4x4</code>.
  How can I get the indices of the following combinations:</p>
  
  <ul>
  <li>row odd and column odd</li>
  <li>row odd and column even</li>
  <li>row even and column odd</li>
  <li>row even and column even</li>
  </ul>
  
  <p>For example if I have the matrix:</p>
  
  <pre><code>1 2 3 4
  5 6 7 8
  9 10 11 12
  13 14 15 16
  </code></pre>
  
  <ul>
  <li>'row odd and column odd' would be the indices of 1, 3, 9, 11...</li>
  <li>'row odd and column even' would be the indices of 2, 4, 10, 12...</li>
  <li>'row even and column odd' would be the indices of 5, 7, 13, 15...</li>
  <li>and 'row even and column even' would be indices of 6, 8, 14, 16...</li>
  </ul>
  
  <p>Also, is it possible to combine those operations so e.g. I get the indices for 'row odd and column odd' and 'row even and column even'?</p>
  
  <p>Thank you!</p>