title: Create diagonal matrix without using MATLAB built-in functions
body: <p>I know the answer to this question as shown below.</p>
  
  <pre><code>function a = reverse_diag(n)
      b = zeros(n);
      b(1:n+1:end) = 1;
      a(1:n, n:-1:1) = b(1:n, 1:n);
  end
  </code></pre>
  
  <p>But why does it look like that? What does this mean?</p>
  
  <pre><code>b(1:n+1:end) = 1;
  </code></pre>