Add all folders/files below a specified point to path.
8 ビュー (過去 30 日間)
古いコメントを表示
Hi all,
I'm trying to add all subfolders below a specific folder to the MATLAB path programmatically.
I am currently using the addpath() function, however if I use this I have to specify every subfolder.
Besides manually clicking on the folder in the browser (right-click, Add to Path, Selected Folder and Subfolders), is there a simple way to do this as an extension of addpath() or similar?
Thanks in advance!
0 件のコメント
回答 (2 件)
Walter Roberson
2020 年 10 月 21 日
編集済み: Walter Roberson
2023 年 4 月 6 日
genpath is designed for that
0 件のコメント
Farrukh Mazhar
2023 年 4 月 6 日
Use the following code to add folder and subfolder in the directory 'd:\Work Dir\Math'
mypath='d:\Work Dir\Math';
addpath(genpath(mypath), '-end');
issue path command to verify
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!