title: Create matrix with n elements from an array
body: <p>Is there a way to create matrix that is consisted of a certain numbers that are stored in an array? For example, I want to create a 10-by-1 matrix consisting only of numbers from an array <code>a = [6,2,15,24]</code>, that are randomly stored in matrix elements. The final product should look something like this:</p>
  
  <pre><code>M = [15,24,2,15,2,6,24,15,2,15]
  </code></pre>