title: Find the range to which a value belongs
body: <p>If I have a column array </p>
  
  <pre><code>A = [2; 4; 6; 8]
  </code></pre>
  
  <p>and say I have a value </p>
  
  <pre><code>X = 3
  </code></pre>
  
  <p>[EDIT]
  I want to identify the values of the range to which it belongs. In this case, we know it is between 2 and 4 and therefore the result is 2 and 4. </p>
  
  <p>However, the problem is that X is unknown. I mean it has to be calculated during the simulation and then only the range is identified (also during the simulation).</p>
  
  <p>Can anyone suggest me how I can code this? Preferably in a vector manner, without loops as I will be dealing with larger arrays.</p>