How to find the search path list inside MATLAB?
All the saved and default paths that MATLAB looks inside to find a function are stored in an m-file called
pathdef.m. You can easily use the
which command to do this:
which pathdef.m -all
The result would be something like this:
If you look inside this file, at the end you can see
userpath.This parameter stores the path to your workspace, for instance:
How to add a path to the search path temporarily?
To do this you can add each folder using the command
This command will add the path to the search list and as soon as you close MATLAB it will be removed from the list.
How to add a path to the search path permanently?
You can use
savepath command to save the path to the
pathdef.m file. This change would be permanently and would not be removed from the search list even if you exit MATLAB.