title: MATLAB: How to read data from a text file that have a certain character
body: <p>I have a txt file, which contains a bunch of random data in two units, Distance (m) and Time (seconds). For example the <code>txt</code> file looks like this:</p>
  
  <pre><code>5 metre 
  
  0 sec
  
  10 metre
  
  1 sec
  
  16 metre
  
  2 sec
  
  25 metre
  
  3 sec
  </code></pre>
  
  <p>I want to be able to store all of the <code>metres</code> values into an array, and the <code>seconds</code> data into another. Basically separating the text file into two arrays based on the metre/sec units.</p>