title: How to write relative path in MATLAB?
body: <p>I need to read a group of dat files so when I do this it is working all right.</p>
  
  <pre><code> list_of_files=dir(fullfile('/home/username/Desktop/Old/MTP/Generate/schemes/o33smnpimp/data/', '*.dat'));
  </code></pre>
  
  <p>The thing is I want to do this for number of schemes (like o33smnpimp) where every scheme folder has a data folder so I tried something like this but it's not working. What could be the problem?</p>
  
  <pre><code>list_of_files=dir(fullfile('../data/', '*.dat'));
  </code></pre>
  
  <p>My matlab file lies in o33smnpimp folder.</p>