Borrar filtros
Borrar filtros

list of folder path

2 visualizaciones (últimos 30 días)
franco otaola
franco otaola el 13 de En. de 2018
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.

Respuestas (0)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by