![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/412523/image.png)
How to generate all paths or directories that are actually used by a script?
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Sometimes the paths contains more than necessary directories for my script.
It is very tedious to get exact which function/script is from which path.
Now I want to run a script, and let Matlab record all the directories it ever visisted/referred in its path, and show it to me so I can simplify the path setting.
Will this be something alreay existed in Matlab?
Thanks!
0 commentaires
Réponses (1)
Pranav Verma
le 13 Nov 2020
Hi Jiansong,
Please refer to dbstack functionality. You can see the location of the functions by setting breakpoints at those functions. Use the "-completenames" option to get the full path of the functions. Below is the snippet from the documentation:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/412523/image.png)
It should help in getting the path to which a function belongs.
Thanks
Voir également
Catégories
En savoir plus sur Search Path dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!