title: How to select elements from array in Julia matching predicate?
body: <p>Julia appears to have a lot of Matlab like features.  I'd like to select from an array using a predicate.  In Matlab I can do this like:</p>
  
  <pre><code>&gt;&gt; a = 2:7 ;
  &gt;&gt; a &gt; 4
  
  ans =
  
       0     0     0     1     1     1
  
  &gt;&gt; a(a&gt;4)
  
  ans =
  
       5     6     7
  </code></pre>
  
  <p>I found a kind of clunky seeming way to do part of this in Julia:</p>
  
  <pre><code>julia&gt; a = 2:7
  2:7
  
  julia&gt; [int(x &gt; 3) for x in a]
  6-element Array{Any,1}:
   0
   0
   1
   1
   1
   1
  </code></pre>
  
  <p>(Using what wikipedia calls <a href="https://en.wikipedia.org/wiki/List_comprehension#Julia" rel="noreferrer">list comprehension</a>).  I haven't figured out how to apply a set like this to select with in Julia, but may be barking up the wrong tree.  How would one do a predicate selection from an array in Julia?</p>