string - How to shorten the length of the path on the one folder in Matlab? -


How to reduce the length of the path in a folder in matlab

i.e. I need a directory up. For example, I have 'C: / mydir / folder1 / folder2' I want 'C: / mydir / folder1'

If you have a folder path in the string, you can use the function:

  currentFolder = pwd; Parentfolder = filippers (current folder);  

Note that if the folder path string is a file separator character (i.e. '/' or '\' ).

If you want to change the current working directory to the original directory, then use it:

  cd ..% or cd ('..')  

Comments