title: Replace the diagonal of matrix
body: <p>I am interesting to replace the diagonal of matrix <code>D</code> to <code>1,2,3,4</code>.
  This is matrix <code>D</code>:</p>
  
  <pre><code>A=[1,2,3,4,2,3,4,5; 3,4,5,6,4,5,6,7];
  D=[A;A];
  D=[D D]; % size of matrix [4x16] %
  </code></pre>