title: Sorting strings in MATLAB like Windows 7 sorts filenames in explorer (respecting numerals mid-string)
body: <p>What is the best way to sort strings in MATLAB, respecting numerals that could be present mid-string?</p>
  
  <p>The following example illustrates my problem. 401 is a numerically higher value than 6. Therefore, the Ie401sp2 string should be listed after the Ie6 string when sorting in ascending order. In this example, note how the following strings, which contain numerals, are sorted.</p>
  
  <p>---Matlab---  (Not sorting the way I want)<br>
  Ie4_01<br>
  Ie4_128<br>
  Ie401sp2<br>
  Ie5<br>
  Ie501sp2<br>
  Ie6  </p>
  
  <p>---Windows 7---  (The way I want MATLAB to sort)<br>
  Ie4_01<br>
  Ie4_128<br>
  Ie5<br>
  Ie6<br>
  Ie401sp2<br>
  Ie501sp2  </p>
  
  <p>Windows 7 respects the relative values of the numerals that appear mid-string.  What is the best way to do this in Matlab?  I am trying to avoid going off on a minor tangent to reinvent the wheel.</p>