title: How to generate unique random numbers in Matlab?
body: <p>I need to generate m unique random numbers in range 1 to n. Currently what I have implemented is:</p>
  
  <pre><code>round(rand(1,m)*(n-1)+1)
  </code></pre>
  
  <p>However, some numbers are repeated in the array. How can I get only unique numbers?</p>