title: How to do genetic operations in matlab
body: <p>I have two matrices. One is <code>I</code> an identity matrix and another <code>A</code> with diagonal 0's and mixed 1's and 0's in other places. By keeping identity matrix as it is, scan the rows from left to right. </p>
  
  <p><code>I</code> is identity matrix </p>
  
  <pre><code>I =
  
       1     0     0     0     0     0     0     0
       0     1     0     0     0     0     0     0
       0     0     1     0     0     0     0     0
       0     0     0     1     0     0     0     0
       0     0     0     0     1     0     0     0
       0     0     0     0     0     1     0     0
       0     0     0     0     0     0     1     0
       0     0     0     0     0     0     0     1
  </code></pre>
  
  <p><code>A</code> matrix:</p>
  
  <pre><code>A =
  
       0     1     1     1     0     0     0     0
       1     0     1     1     0     0     0     0
       1     1     0     1     1     1     0     0
       1     1     1     0     1     1     1     0
       0     1     1     1     0     1     1     1
       0     0     1     1     1     0     1     1
       0     0     0     1     1     1     0     1
       0     0     0     0     1     1     1     0
  </code></pre>
  
  <p><code>Result</code> matrix</p>
  
  <pre><code>Result =
  
       1     0     0     0     1     0     0     0
       0     1     0     0     0     1     0     0
       0     0     1     0     0     0     1     0
       0     0     0     1     0     0     0     1
  </code></pre>