pathdef.m, MATLAB upgrade, and Linux
Show older comments
I use a custom pathdef.m on linux. When I upgrade my MATLAB, the pathdef.m file from the previous setup isn't correct anymore because pathdef.m contains both MATLAB system paths and my paths. This means my path breaks when I upgrade MATLAB or when I switch between versions but have one pathdef.m.
There has to be a better way to manage the path. If I just add my user paths to the default system paths in startup.m, this seems like this would work across different versions of MATLAB.
Is there a recommended way to handle the path across multiple versions of MATLAB?
Example startup.m for use across different matlab versions
% my custom path
p = ['/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/subtightplot:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/shortTimeFourierTransform:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/robustDifferentiators:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/RegularizeData3D:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/regexpBuilder/html:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/regexpBuilder:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/rainflow:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/quadlab-matlab-2.3:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/measuretool_1.13:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/hyp2f1mex:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/genetic:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/FMINSEARCHBND:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/figstate:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/20130227_xlwrite:', ...
'/home/jnicholson/Documents/MATLAB/UserDefinedFunctions/20130227_xlwrite/poi_library:'];
path(p, path());
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!