Hi Adriel,
Here's one approach, concatenation
outD = 'C:\Users\myusername\Documents\subfolder1\subfolder2\subfolder3\myProject_Folder';
txt_files_path = [outD, '\txt_files_Folder']
txt_files_path2 = [outD, '\new_txt_files_Folder2']
You can also make use of the cd function. In my case
Cpath = cd
Cpath = 'c:\users\dave\tech\matlab'
which is a string you can concatenate with something else as with outD, or lop part of it off.
If you have a home base and want to go to the end of some path and temporarily make it the local directory you can do
home_path = cd
cd(txt_files_path)
Then you can read files in and out locally with no path prefix. After that, cd(home_path) takes you back from whence you came.
Lots of possibilities, this is kind of the 'original' way and if there are more sophisticated ways I imagine others will weigh in.
Best Answer