title: Uniform random number generation from a set
body: <p>I would like to find out if there is a function that can generate random numbers from a set of numbers in Matlab? For instance say I have the set [-1 1]. How can I generate numbers from that set? I have tried to use randi([-1,1]) but that obviously will generate the numbers -1,0 and 1 and I would like to generate numbers uniformly WITHOUT the 0 and only include -1 and 1. I apologise in advance if this seems like a trivial question but I can't seem to find the answer.</p>
  
  <p>Thanks for any help you can provide.</p>
  
  <p>Edit: I've found a simple solution for the above: (randi([0 1])*2) - 1. This only solves this problem and not a generation of numbers from a specified set.</p>