title: Multiply some members of an array by independenly drawn random numbers
body: <p>Suppose that I have a 1D array like so:</p>
  
  <pre><code>julia&gt; myarray = ones(6)
  6-element Array{Float64,1}:
   1.0
   1.0
   1.0
   1.0
   1.0
   1.0
  </code></pre>
  
  <p>I make a mask that will select some elements, the first and second element in this example:</p>
  
  <pre><code>julia&gt; mymask = [true; true; false; false; false; false;]
  6-element Array{Bool,1}:
    true
    true
   false
   false
   false
   false
  </code></pre>
  
  <p>Now I want to multiply only the first and second elements by random numbers drawn from the same distribution, and save the result over the old array. But this will multiply them by the <em>same</em> value: </p>
  
  <pre><code>julia&gt; myarray[mymask] = myarray[mymask] * rand(Normal(20,5))
  julia&gt; myarray
  6-element Array{Float64,1}:
   16.5642
   16.5642
    1.0
    1.0
    1.0
    1.0
  </code></pre>
  
  <p>My next thought was to try <code>myarray[mymask] = myarray[mymask] * rand(Normal(20,5),2)</code> but it gives an error. </p>