How to add a folder permanently to matlab path?

조회 수: 908(최근 30일)
Dishant Arora
Dishant Arora 2014년 2월 14일
댓글: Ronald Modesitt 2020년 12월 20일
I am using addpath to add specified folders to matlab path, but it removes the folders from the matlab path everytime the application closes. I want to add that particular folder permanently to matlab path, so that I don't have to add it again everytime i run the application. How can it be done??
Any help is appreciated.

채택된 답변

Thomas
Thomas 2014년 2월 14일
편집: Thomas 2014년 2월 14일
You can put the addpath statement to startup.m
  댓글 수: 2
Ronald Modesitt
Ronald Modesitt 2020년 12월 20일
I am also using this method for my user written functions.

댓글을 달려면 로그인하십시오.

추가 답변(2개)

Jan
Jan 2014년 2월 14일
addpath YourFolder
savepath

Luís Fresco
Luís Fresco 2019년 7월 3일
On Matlab's toolstrip, you may find the option "Set Path" which allows to select one directory (or also its subfolders) and save it permanently to Matlab's "search path".
Untitled.png
  댓글 수: 2
adrieto
adrieto 2020년 3월 29일
I used the solution proposed by Luis Fresco. It worked (I didn't need to do it every time I restarted MatLab). Into the default search path I added a new folder with some functions in it. I put "Add with subfolders", selected the main folder and when a new window pop-up, just accept that.
I wrote a script in the main folder which uses a function into the subfolder, and it worked just fine. I restarted MatLab to check if the solution was permanently, and it is.

댓글을 달려면 로그인하십시오.

범주

Find more on Search Path in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by