title: How can I create a triangular matrix based on a vector, in MATLAB?
body: <p>Let's say I've got a vector like this one:</p>
  
  <pre><code>A = [101:105]
  </code></pre>
  
  <p>Which is really:</p>
  
  <pre><code>[ 101, 102, 103, 104, 105 ]
  </code></pre>
  
  <p>And I'd like to use only vector/matrix functions and operators to produces the matrix:</p>
  
  <pre><code>101 102 103 104 105
  102 103 104 105 0
  103 104 105 0   0
  104 105 0   0   0
  105 0   0   0   0
  </code></pre>
  
  <p>or the following matrix:</p>
  
  <pre><code>101 102 103 104 105
  0   101 102 103 104
  0   0   101 102 103
  0   0   0   101 102
  0   0   0   0   101
  </code></pre>
  
  <p>Any ideas anyone? </p>
  
  <p>(I'm very much a novice in MATLAB, but I've been saddled this stuff...)</p>