title: how can I select a random element from an array in matlab
body: <p>How can I make the program select a random element from an array. So:</p>
  <pre><code>A=[1 2 3 4]
  </code></pre>
  <p>random= random element of A</p>
  <p>I tried randsample(A,1) and randi(A) and neither worked so what can I do</p>