I'm trying to just loop through some folders using a list of strings in Matlab and everything I've tried hasn't worked.
For instance, if I had three names, all I'd want is to loop through some folders like this:
names = ['Tom', 'Dick', 'Harry']
SourceDir = /path/to/my/files
for name = 1:length(names)
mkdir SourceDir, "/things_belonging_to_", names(name), "/new_things"
OutputDir = (SourceDir, "/things_belonging_to_", names(name), "/new_things")
cd "/things_belonging_to_", names(name), "/oldthings"
% do other stuff that will be dumped in OutputDir
end
I've tried using {} instead of [], I tried to use sprintf and fullfile. All I want is a really boring for-loop and I cannot seem to find/understand the documentation that shows me how to use strings in the mkdir or cd command. I always end up with string input not supported or Arguments must contain a character vector.