title: Error margin for a value in an if statement in Matlab?
body: <p>I have a simple for loop :</p>
  
  <pre><code>for n=0:0.001:100
    if x&lt;100
      do something
    end
  end
  </code></pre>
  
  <p>However, due to the complexity of the code, the final value of x is around 100.345, hence the loop breaks.</p>
  
  <p>I want to apply an error margin where <code>if x&lt;100 ± 0.4</code> so that the statement is true and the loop restarts.</p>
  
  <p>How is this possible ?</p>