필터 지우기
필터 지우기

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

조회 수: 3 (최근 30일)
SRance
SRance 2020년 10월 21일
편집: Walter Roberson 2023년 4월 6일
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!

답변 (2개)

Walter Roberson
Walter Roberson 2020년 10월 21일
편집: Walter Roberson 2023년 4월 6일

Farrukh Mazhar
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

카테고리

Help CenterFile Exchange에서 Search Path에 대해 자세히 알아보기

태그

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by