Add all folders/files below a specified point to path.
7 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (2)
Walter Roberson
il 21 Ott 2020
Modificato: Walter Roberson
il 6 Apr 2023
genpath is designed for that
0 Commenti
Farrukh Mazhar
il 6 Apr 2023
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 Commenti
Vedere anche
Categorie
Scopri di più su Search Path in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!