structuring of folder name

2 次查看(过去 30 天)
how can i divide the path like C:/document/data/data-1/ into a structure which contain name of individual folder like {document, data, data-1} or just access the last folder into a variable like x = data-1.

采纳的回答

Image Analyst
Image Analyst 2016-7-10
Try this:
folder = 'C:/document/data/data-1/'
individualFolders = strsplit(folder, '/')
folder =
C:/document/data/data-1/
individualFolders =
'C:' 'document' 'data' 'data-1' ''

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 String Parsing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by