list of folder path
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!