title: Sorting data in MATLAB dependant on one column
body: <p>How do I sort a column based on the values in another column in MATLAB?</p>
  
  <p>Column <code>A</code> shows position data (it is neither ascending or descending in order) Column <code>B</code> contains another column of position data. Finally column <code>C</code> contains numerical values. Is it possible to link the first position value in <code>B</code> with its numerical value in the first cell of <code>C</code>? Then after this I want to sort <code>B</code> such that it is in the same order as column <code>A</code> with the <code>C</code> values following their <code>B</code> counterparts?The length of my columns would be 1558 values.</p>
  
  <p>Before case;</p>
  
  <pre><code>A     B     C
  1      4      10
  4      1      20
  3      5      30
  5      2      40
  2      3      50
  </code></pre>
  
  <p>After Case;</p>
  
  <pre><code>A     B     C
  1      1      20
  4      4      10
  3      3      50
  5      5      30
  2      2      40
  </code></pre>
  
  <p>Basically <code>A</code> and <code>B</code> became the same and Column <code>C</code> followed <code>B</code>.</p>