A list file paths of the files in the folder
Show older comments
I want to create a list of all the files in a folder with relative paths to 2 steps upward parent folder. I have used this code so far:
o_file_list = dir(Dir_name);
for ii = 1:length(o_file_list);
[pathstr,name,extension] = fileparts(o_file_list(ii).name);
end
output = o_file_list;
But the thing is I know how to create a list of files in the folder, but I can't find any info how to construct relative paths to a folder of my choice. Any help would be appreciated.
Best, Gert
Accepted Answer
More Answers (0)
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!