title: Matlab decreasing matrix diagonal
body: <p>I want to create a matrix where the middle diagonal is symmetrically decreasing to the sides, like this:</p>
  
  <pre><code>5 4 3 2 1
  4 5 4 3 2
  3 4 5 4 3
  2 3 4 5 4
  1 2 3 4 5
  </code></pre>
  
  <p>The matrix has to be 100x100 and the values are between <code>0</code> and <code>1</code>.
  Until now I only get the edges and the middle diagonal, but can't get the idea on how to automatically fill the rest.</p>
  
  <pre><code>v = ones(1,100);
  green = diag(v);
  green(:,1) = fliplr(0:1/99:1);
  green(1,:) = fliplr(0:1/99:1);
  green(100,:) = 0:1/99:1;
  green(:,100) = 0:1/99:1;
  </code></pre>