title: MATLAB Sorting by custom condition
body: <p>I have an array of 2D Cartesian points in MATLAB and I'd like to sort them so that putting them into <code>plot</code> would create a polygon with no line overlaps.</p>
  
  <p>(NB. I'm not actually going to plot in MATLAB, I just need to sort them in that manner)</p>
  
  <p>I'm thinking of writing a loop that would find the polar coordinate system's 'theta' for a vector going from a new point I know to be inside the polygon to each of the polygon's points, then sorting according to that value, but it seems very hacky and inefficient!</p>
  
  <p>Any tips?</p>