title: How to deal with paired values?
body: <p>Say I have a vector of independent variable values</p>
  
  <pre><code>v =[ 1 2 2 1 1 .5 1 2 .5 .5 1]
  </code></pre>
  
  <p>and a vector of response variables</p>
  
  <pre><code>u = [ 5 22 20 4 8 .2 5 12 0 .5 6]
  </code></pre>
  
  <p>I want to plot <code>u</code> vs. <code>v</code> with errorbars, the method needs to work for 100s of possible values for the independent variable. The problem isn't in plotting the error bars, it's in how can I create a vector pair <code>[mean(u(find(v==0.5)), mean(u(find(v==1)), mean(u(find(v==2))]</code>. Is there a standard automated way of doing this other than sorting <code>v</code>, then picking out the values of sorted <code>v</code> and finding the index of <code>v</code> where <code>v</code> matches those values? This seems very inefficient.</p>