title: How to change the value of the diagonal column of the matrix?
body: <p>How do I change the list of value to all <code>1</code>? I need the top right to bottom left also end up with <code>1</code>.</p>
  
  <pre><code>rc = input('Please enter a value for rc: ');
  mat = ones(rc,rc);
  for i = 1:rc
      for j = 1:rc
          mat(i,j) = (i-1)+(j-1);
      end
  end
  final = mat
  final(diag(final)) = 1 % this won't work?
  </code></pre>