Add folders and subfolders to projrct through script
2 次查看(过去 30 天)
显示 更早的评论
I want to Add folders and subfolders to project through script. Please five me matlab commands to do so.
回答(1 个)
Andrew Newell
2015-3-16
2 个评论
Andrew Newell
2015-3-16
Sorry, I misunderstood your question. I don't have any experience with projects, but this might work (for the full path name of your folder):
fileTree = genpath(full_path_name);
proj=slproject.getcurrentproject;
filenames = textscan(fileTree,'%s','Delimiter',':');
for ii=1:length(filenames)
proj.addfiles(filenames{ii});
end
The idea is to use genpath and textscan to create a cell array of the names of your folder and subfolders, and then to add them one at a time. However, it may not add the files that are in those folders.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 File Operations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!