title: What does "uniquetol" do, exactly?
body: <p>The <a href="https://es.mathworks.com/help/matlab/ref/uniquetol.html" rel="nofollow noreferrer"><code>uniquetol</code></a> function, introduced in R2015a, computes "unique elements within tolerance". Specifically,</p>
  
  <blockquote>
    <p><code>C = uniquetol(A,tol)</code> returns the unique elements in <code>A</code> using tolerance <code>tol</code>.</p>
  </blockquote>
  
  <p>But the problem of finding unique elements with a given tolerance has <strong>several solutions</strong>. Which one is actually produced?</p>
  
  <p>Let's see two examples:</p>
  
  <ol>
  <li><p>Let <code>A = [3 5 7 9]</code> with absolute tolerance <code>2.5</code>. The output can be <code>[3 7]</code>,  or it can be <code>[5 9]</code>. Both solutions satisfy the requirement.</p></li>
  <li><p>For <code>A = [1 3 5 7 9]</code> with absolute tolerance <code>2.5</code>, the output can be <code>[1 5 9]</code> or <code>[3 7]</code>. So even the <em>number</em> of elements in the output can vary.</p></li>
  </ol>
  
  <p>See <a href="https://stackoverflow.com/a/1988838/2586922">this nice discussion</a> about the transitivity issue that lies at the heart of the problem.</p>
  
  <p>So, how does <code>uniquetol</code> work? What output does it produce among the several existing solutions?</p>