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};
댓글 수: 0
채택된 답변
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
Image Analyst
2016년 1월 26일
You forgot to paste the error message.
What is the name of the deepest, longest folder that it chokes on?
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Search Path에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!