title: Using result from a function to access a julia array
body: <p>I'm new to julia and have a problem.  I have an array, y.  </p>
  
  <pre><code>y = rand (5, 10)
  y [1. 1] = 0
  </code></pre>
  
  <p>Running this gives me an error</p>
  
  <pre><code>for j=1:d   
      x_filt [j, 1] = y [j, findfirst (y [j, :])]
  end
  
  ERROR: syntax: missing separator in array expression
  </code></pre>
  
  <p>But this doesn't </p>
  
  <pre><code>for j=1:d   # fix to 1st obs if 1st tick is missing
      temp = findfirst (y [j, :])
      x_filt [j, 1] = y [j, temp];        
  end 
  </code></pre>
  
  <p>Can someone explain how to make the first version work?  Or at least explain why it doesn't?</p>
  
  <p>Thanks!</p>