title: Random numbers that add to 100: Matlab
body: <p>[I'm splitting a population number into different matrices and want to test my code using random numbers for now.]</p>
  
  <p>Quick question guys and thanks for your help in advance -</p>
  
  <p>If I use;</p>
  
  <pre><code> 100*rand(9,1)
  </code></pre>
  
  <p><em>What is the best way to make these 9 numbers add to 100?</em> </p>
  
  <p>I'd like 9 random numbers between 0 and 100 that add up to 100.</p>
  
  <p>Is there an inbuilt command that does this because I can't seem to find it.</p>