I have a directory called MATLAB in which i have all my .m codes and couple of separate folders, each folder further has subfolders, How can i call the subfolders?

2 次查看(过去 30 天)
for y=1979:2012;
% open binary file for % Polar Pathfinder Daily 25 km EASE-Grid Sea Ice Motion Vectors, Version 2
folderpath = ('/Users/Documents/MATLAB/weeks/');
stryear = num2str(y);
filepath = fullfile(folderpath,stryear);
files = dir(fullfile(filepath,'/icemotion.mean.week.*.n.v02.bin') );
files = {files.name};

采纳的回答

Image Analyst
Image Analyst 2016-1-25
You can use genpath() to generate a list of all subfolders. Then you can do stuff with files in those folders. See my attached demo.
  5 个评论

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Search Path 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by