How can I set the path in Matlab?

I have written some codes for my project in Matlab. These codes consist of some functions and a main startup file, which are all written separately and stored in a folder. When I want to run a project, I have to set the Matlab path to this folder and then run the main file.

Now I want to use another tool in my project that is being developed by a third party. As I said, I want to use this toolbox

in my own project, but I can only set the Matlab path to one of those directories. I was thinking if there is a way to add this toolbox to the main path from Matlab so that it can run like other predefined Matlab functions for example fmincon

.

+2


source to share


1 answer


In the case of the toolbar, I would add it to the main Matlab search path. You can do this using Set Path in the main panel:

enter image description here



Click Add with subfolders and select the toolbar.

For your project, I would add a folder to your main function just using . This parameter is temporary! If your folder contains a set of functions that you always use, you can also add it permanently as above using Set Path. But be aware of sharing this folder with others if they want to use your project. addpath

+5


source







All Articles