list of folder path
1 view (last 30 days)
Show older comments
hello,
i couldn't find any function to obtain the different folders in the current path. for example if i do:
cwd
ans=c:/folder1/folder2/folder3
i wanted to have something like this {'C','folder1','folder2','folder3'} for the moment what i am doing to recover the 'folder3' the only one that i arrived to recover (i want to use the code with different folders paths with different folders name length so i cant read the path and cut parts with
ans(end-14:end-8)
ans='folder2'
so to recover 'folder3' with any length of folders names i made is this code:
folder=pwd;
[upperPath,~,~]=fileparts(folder);
deepestFolder=folder(length(upperPath)+2:end)
deepestFolder='folder3'
if anyone could help me with this issue i would appreciate.
0 Comments
Answers (0)
See Also
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!