MATLAB Answers

Add all folders/files below a specified point to path.

5 views (last 30 days)
SRance
SRance on 21 Oct 2020
Answered: Walter Roberson on 21 Oct 2020
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 Comments

Sign in to comment.

Answers (1)

Walter Roberson
Walter Roberson on 21 Oct 2020
https://www.mathworks.com/help/matlab/ref/genpath.html
genpath is designed for that

  0 Comments

Sign in to comment.

Tags

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by