Add folders and subfolders to projrct through script

I want to Add folders and subfolders to project through script. Please five me matlab commands to do so.

1 件のコメント

KUSHAL REDDY
KUSHAL REDDY 2015 年 3 月 16 日
編集済み: Andrew Newell 2015 年 3 月 16 日
Sorry, I want to include it to project (Add to project or ADD subfolders to project) through script.
proj=slproject.getcurrentproject
proj.addfiles(dir)
will only add that dir to project not sub folders. I want command to add subfolders too.

サインインしてコメントする。

回答 (1 件)

Andrew Newell
Andrew Newell 2015 年 3 月 16 日

0 投票

See mkdir.

2 件のコメント

KUSHAL REDDY
KUSHAL REDDY 2015 年 3 月 16 日
編集済み: Andrew Newell 2015 年 3 月 16 日
Sorry, I want to include it to project (Add to project or ADD subfolders to project) through script.
proj=slproject.getcurrentproject
proj.addfiles(dir)
will only add that dir to project not sub folders. I want command to add subfolders too.
Andrew Newell
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.

サインインしてコメントする。

カテゴリ

ヘルプ センター および File ExchangeFile Operations についてさらに検索

製品

タグ

質問済み:

2015 年 3 月 16 日

コメント済み:

2015 年 3 月 16 日

Community Treasure Hunt

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

Start Hunting!

Translated by