title: changing folder name, matlab
body: <p>I want to set path for my text file programmatically. e.g.,</p>
  
  <pre><code>file = 'H:\user4\matlab\myfile.txt';
  [pathstr, name, ext] = fileparts(file)
  
  pathstr =    H:\user4\matlab
  
  name =    myfile
  
  ext =    .txt
  </code></pre>
  
  <p>I want to write all file in <code>H:\user4\myfile</code>. How can I get this name.</p>
  
  <p>I want     <code>newfilepath=strcat(pathstr,'myfile').</code> </p>
  
  <p>Obviously it gives <code>H:\user4\matlab\myfile</code> what I don't want. How can I write my code.</p>