title: How to make a random number generator in matlab that is based on percentages?
body: <p>I am currently using the built in random number generator. </p>
  
  <p>for example</p>
  
  <p>nAsp = randi([512, 768],[1,1]); </p>
  
  <p>512 is the lower bound and 768 is the upper bound, the random number generator chooses a number from between these two values.</p>
  
  <p>What I want is to have two ranges for nAsp but I want one of them to get called 25% of the time and the other 75% of the time. Then gets plugged into he equation. Does anyone have any ideas how to do this or if there is a built in function in matlab already?</p>
  
  <p>for example</p>
  
  <p>nAsp = randi([512, 768],[1,1]);  gets called 25% of the time</p>
  
  <p>nAsp = randi([690, 720],[1,1]);  gets called 75% of the time</p>